Restructured the 'multiproject' test project.
Adam Murdoch [Thu, 20 Sep 2012 01:30:08 +0000 (11:30 +1000)]
- Renamed packages to 'com.example.android'.
- Added a second library.
- Moved some code from app to library project.

Change-Id: If37d5fa07f4c120a452179767492b9582ff24027

14 files changed:
gradle/src/main/groovy/com/android/build/gradle/AndroidPlugin.groovy
testapps/multiproject/app/build.gradle
testapps/multiproject/app/src/main/AndroidManifest.xml
testapps/multiproject/app/src/main/java/com/example/android/multiproject/MainActivity.java [moved from testapps/multiproject/app/src/main/java/org/gradle/sample/MainActivity.java with 91% similarity]
testapps/multiproject/baseLibrary/build.gradle [new file with mode: 0644]
testapps/multiproject/baseLibrary/src/main/AndroidManifest.xml [new file with mode: 0644]
testapps/multiproject/build.gradle
testapps/multiproject/library/build.gradle
testapps/multiproject/library/src/main/AndroidManifest.xml [new file with mode: 0644]
testapps/multiproject/library/src/main/java/com/example/android/multiproject/ShowPeopleActivity.java [moved from testapps/multiproject/app/src/main/java/org/gradle/sample/ShowPeopleActivity.java with 82% similarity]
testapps/multiproject/settings.gradle
testapps/multiproject/util/build.gradle
testapps/multiproject/util/src/main/java/com/example/android/multiproject/person/People.java [moved from testapps/multiproject/util/src/main/java/org/gradle/sample/People.java with 82% similarity]
testapps/multiproject/util/src/main/java/com/example/android/multiproject/person/Person.java [moved from testapps/multiproject/util/src/main/java/org/gradle/sample/Person.java with 78% similarity]

index ca1235b..3a821b3 100644 (file)
@@ -300,6 +300,7 @@ class AndroidPlugin extends AndroidBasePlugin implements Plugin<Project> {
         variant.config.androidDependencies = bundles
 
         // TODO - attach jars
+        // TODO - filter bundles out of source set classpath
 
         return prepareDependenciesTask
     }
index 0b715e3..683178e 100644 (file)
@@ -4,12 +4,12 @@
 
 apply plugin: 'android'
 
-version='1.0'
-
-repositories {
-    mavenCentral()
+android {
+    target 'android-15'
 }
 
 dependencies {
+    compile project(':library')
+    // TODO - this should not be here
     compile project(':util')
 }
index 1f411e0..44a4d20 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="org.gradle.sample"
+      package="com.example.android.multiproject"
       android:versionCode="1"
       android:versionName="1.0">
     <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
@@ -14,9 +14,6 @@
         <activity
                 android:name="ShowPeopleActivity"
                 android:label="@string/title_activity_display_message" >
-                <meta-data
-                    android:name="android.support.PARENT_ACTIVITY"
-                    android:value="org.gradle.sample.MainActivity" />
             </activity>
     </application>
 </manifest>
diff --git a/testapps/multiproject/baseLibrary/build.gradle b/testapps/multiproject/baseLibrary/build.gradle
new file mode 100644 (file)
index 0000000..961905d
--- /dev/null
@@ -0,0 +1,9 @@
+apply plugin: 'android-library'
+
+android {
+    target 'android-16'
+}
+
+dependencies {
+    compile project(':util')
+}
diff --git a/testapps/multiproject/baseLibrary/src/main/AndroidManifest.xml b/testapps/multiproject/baseLibrary/src/main/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..54d079c
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.android.multiproject.library.base">
+</manifest>
index 0c73a9f..c0bebba 100644 (file)
@@ -6,3 +6,11 @@ buildscript {
         classpath 'com.android.build:gradle-android:0.1-SNAPSHOT'
     }
 }
+
+allprojects {
+    version = '1.0'
+
+    repositories {
+        mavenCentral()
+    }
+}
index 48c76ec..a5f742c 100644 (file)
@@ -1 +1,10 @@
 apply plugin: 'android-library'
+
+android {
+    target 'android-15'
+}
+
+dependencies {
+    compile project(':baseLibrary')
+    compile project(':util')
+}
diff --git a/testapps/multiproject/library/src/main/AndroidManifest.xml b/testapps/multiproject/library/src/main/AndroidManifest.xml
new file mode 100644 (file)
index 0000000..e64befa
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.android.multiproject.library">
+</manifest>
@@ -1,4 +1,4 @@
-package org.gradle.sample;
+package com.example.android.multiproject;
 
 import android.app.Activity;
 import android.os.Bundle;
@@ -8,6 +8,9 @@ import android.widget.TextView;
 import java.lang.String;
 import java.util.Arrays;
 
+import com.example.android.multiproject.person.Person;
+import com.example.android.multiproject.person.People;
+
 public class ShowPeopleActivity extends Activity {
     @Override
     public void onCreate(Bundle savedInstanceState) {
index ab6a454..4ba4df5 100644 (file)
@@ -1,3 +1,4 @@
 include 'app'
 include 'library'
+include 'baseLibrary'
 include 'util'
index f4a999a..0f2c256 100644 (file)
@@ -1,11 +1,5 @@
 apply plugin: 'java'
 
-version='1.0'
-
-repositories {
-    mavenCentral()
-}
-
 dependencies {
     compile 'com.google.guava:guava:11.0.2'
 }