Fix support for building and testing libraries.
authorXavier Ducrohet <xav@android.com>
Thu, 30 Aug 2012 02:23:33 +0000 (19:23 -0700)
committerXavier Ducrohet <xav@android.com>
Thu, 30 Aug 2012 21:14:49 +0000 (14:14 -0700)
commit8701f803f6dc247cca3ae7cda9a703f497907761
tree5037544e2b07f41cdcd4384efef9bd9bfa1a5d5d
parent30eaca7a776966f9488d9dc90ab6b65f9b134a5a
Fix support for building and testing libraries.

Libraries weren't properly builds due to:
--non-constant-id was not used
--extra-packages was not used.

Also this creates a fake AndroidDependency for the tested
config so that it can be added to the dependency of the test
app.

Finally, this fixes some of the issues around classpath.
The Dex task receives separately the compiled code and the
library to planned for pre-dexing the libraries. The libraries
are handled through the AndroidDependency class provided
to the VariantConfig.
The compileTask setup is more precise in what is the
compiled *and packaged* classpath vs just a compile classpath
(this is different for test apps depending on if the test target
is a library or an app).

Change-Id: I0be9da2ce03bb48f40f4577e4323edf50062f2c0
38 files changed:
.gitignore
builder/prebuilts/manifmerger.jar
builder/src/main/java/com/android/builder/AndroidBuilder.java
builder/src/main/java/com/android/builder/AndroidDependency.java
builder/src/main/java/com/android/builder/SourceSet.java
builder/src/main/java/com/android/builder/VariantConfiguration.java
gradle/src/main/groovy/com/android/build/gradle/AndroidBasePlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/AndroidLibraryPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/AndroidPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/Dex.groovy
gradle/src/main/groovy/com/android/build/gradle/ProcessManifest.groovy
gradle/src/main/groovy/com/android/build/gradle/ProcessResources.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/AndroidSourceSet.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/ApplicationVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/ProductionAppVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/TestAppVariant.groovy
testapps/applibtest/app/build.gradle [new file with mode: 0644]
testapps/applibtest/app/proguard-project.txt [new file with mode: 0644]
testapps/applibtest/app/src/main/AndroidManifest.xml [new file with mode: 0644]
testapps/applibtest/app/src/main/res/drawable-hdpi/ic_launcher.png [new file with mode: 0644]
testapps/applibtest/app/src/main/res/drawable-ldpi/ic_launcher.png [new file with mode: 0644]
testapps/applibtest/app/src/main/res/drawable-mdpi/ic_launcher.png [new file with mode: 0644]
testapps/applibtest/app/src/main/res/drawable-xhdpi/ic_launcher.png [new file with mode: 0644]
testapps/applibtest/app/src/main/res/values/strings.xml [new file with mode: 0644]
testapps/applibtest/app/src/test/AndroidManifest.xml [new file with mode: 0644]
testapps/applibtest/app/src/test/java/com/android/tests/testprojecttest/lib/LibActivityTest.java [new file with mode: 0644]
testapps/applibtest/app/src/test/java/com/android/tests/testprojecttest/test/AllTests.java [new file with mode: 0644]
testapps/applibtest/build.gradle [new file with mode: 0644]
testapps/applibtest/lib/build.gradle [new file with mode: 0644]
testapps/applibtest/lib/proguard-project.txt [new file with mode: 0644]
testapps/applibtest/lib/src/main/AndroidManifest.xml [new file with mode: 0644]
testapps/applibtest/lib/src/main/java/com/android/tests/testprojecttest/lib/LibActivity.java [new file with mode: 0644]
testapps/applibtest/lib/src/main/res/layout/main.xml [new file with mode: 0644]
testapps/applibtest/lib/src/main/res/values/strings.xml [new file with mode: 0644]
testapps/applibtest/lib/src/test/java/com/android/tests/testprojecttest/lib/LibActivityTest.java [new file with mode: 0644]
testapps/applibtest/lib/src/test/java/com/android/tests/testprojecttest/test/AllTests.java [new file with mode: 0644]
testapps/applibtest/lib/src/test/res/values/strings.xml [new file with mode: 0644]
testapps/applibtest/settings.gradle [new file with mode: 0644]