Change the way AndroidBuilder is configured.
authorXavier Ducrohet <xav@android.com>
Fri, 24 Aug 2012 22:50:38 +0000 (15:50 -0700)
committerXavier Ducrohet <xav@android.com>
Mon, 27 Aug 2012 19:18:27 +0000 (12:18 -0700)
commit59917af54d258431f1c76188367326c827de6469
tree6da374857d63a646aa1df0a2f940b6e16dd6352c
parent7acd5fa2ae5ad226334d62141a7ba9cb94d083c6
Change the way AndroidBuilder is configured.

In order to build test apps and library apps we need
to seriously change the configuration of the builder.

It now receives a VariantConfiguration that contains
all that is needed. If the builder builds a test app
it also receives a VariantConfiguration for the tested
app.
This is critical for building apps that test libraries
as they will embed the library.

Also, the plugin now creates all tasks in afterEvaluate
as it is a lot simpler to loop on all build types and
product flavors. It also allow conditionally creating
some tasks based on the configuration of the project
flavors and build types.

Made a copy of the basic testapps where the build
is configured for multi-flavors.

Change-Id: Ib9a70b6fa79dec6cf939e1d4bd2e75559529e820
44 files changed:
builder/src/main/java/com/android/builder/AndroidBuilder.java
builder/src/main/java/com/android/builder/BuildConfigGenerator.java
builder/src/main/java/com/android/builder/BuildType.java
builder/src/main/java/com/android/builder/BuildTypeHolder.java [deleted file]
builder/src/main/java/com/android/builder/DefaultManifestParser.java
builder/src/main/java/com/android/builder/ManifestParser.java
builder/src/main/java/com/android/builder/ProductFlavorHolder.java [deleted file]
builder/src/main/java/com/android/builder/SourceSet.java [moved from builder/src/main/java/com/android/builder/PathProvider.java with 87% similarity]
builder/src/main/java/com/android/builder/TemplateProcessor.java [new file with mode: 0644]
builder/src/main/java/com/android/builder/TestManifestGenerator.java [new file with mode: 0644]
builder/src/main/java/com/android/builder/VariantConfiguration.java [new file with mode: 0644]
builder/src/main/resources/com/android/builder/AndroidManifest.template [new file with mode: 0644]
builder/src/test/java/com/android/builder/AndroidBuilderTest.java [deleted file]
builder/src/test/java/com/android/builder/BuildTypeHolderMock.java [deleted file]
builder/src/test/java/com/android/builder/BuildTypeTest.java
builder/src/test/java/com/android/builder/MockSourceSet.java [moved from builder/src/test/java/com/android/builder/samples/DefaultPathProvider.java with 79% similarity]
builder/src/test/java/com/android/builder/ProductFlavorHolderMock.java [deleted file]
builder/src/test/java/com/android/builder/VariantConfigurationTest.java [new file with mode: 0644]
builder/src/test/java/com/android/builder/samples/Main.java [deleted file]
gradle/src/main/groovy/com/android/build/gradle/AndroidBasePlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/AndroidExtension.groovy
gradle/src/main/groovy/com/android/build/gradle/AndroidLibraryPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/AndroidLogger.groovy
gradle/src/main/groovy/com/android/build/gradle/AndroidPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/BaseAndroidExtension.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/AndroidSourceSet.groovy [moved from gradle/src/main/groovy/com/android/build/gradle/internal/BaseDimension.groovy with 64% similarity]
gradle/src/main/groovy/com/android/build/gradle/internal/BuildTypeData.groovy [moved from gradle/src/main/groovy/com/android/build/gradle/internal/BuildTypeDimension.groovy with 57% similarity]
gradle/src/main/groovy/com/android/build/gradle/internal/ProductFlavorData.groovy [moved from gradle/src/main/groovy/com/android/build/gradle/internal/ProductFlavorDimension.groovy with 50% similarity]
gradle/src/main/groovy/com/android/build/gradle/internal/ProductionAppVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/TestAppVariant.groovy
testapps/basic/build.gradle
testapps/flavored/build.gradle [new file with mode: 0644]
testapps/flavored/debug.keystore [new file with mode: 0644]
testapps/flavored/src/main/AndroidManifest.xml [new file with mode: 0644]
testapps/flavored/src/main/java/org/gradle/sample/BuildType.java [new file with mode: 0644]
testapps/flavored/src/main/java/org/gradle/sample/MainActivity.java [new file with mode: 0644]
testapps/flavored/src/main/java/org/gradle/sample/Person.java [new file with mode: 0644]
testapps/flavored/src/main/java/org/gradle/sample/ShowPeopleActivity.java [new file with mode: 0644]
testapps/flavored/src/main/res/drawable-hdpi/ic_launcher.png [new file with mode: 0644]
testapps/flavored/src/main/res/drawable-ldpi/ic_launcher.png [new file with mode: 0644]
testapps/flavored/src/main/res/drawable-mdpi/ic_launcher.png [new file with mode: 0644]
testapps/flavored/src/main/res/drawable-xhdpi/ic_launcher.png [new file with mode: 0644]
testapps/flavored/src/main/res/layout/main.xml [new file with mode: 0644]
testapps/flavored/src/main/res/values/strings.xml [new file with mode: 0644]