Use AndroidBuilder to build basic APK.
authorXavier Ducrohet <xav@android.com>
Wed, 22 Aug 2012 02:00:28 +0000 (19:00 -0700)
committerXavier Ducrohet <xav@android.com>
Thu, 23 Aug 2012 21:53:33 +0000 (14:53 -0700)
commitecf57a15b4b3dfa807f61c2b954350f1e030abf3
treefdafb0af89aad68a4d8a85b3f8220edf29e3de30
parent34f3d657c75d73263ec1682705c77677613667f5
Use AndroidBuilder to build basic APK.

Notable changes:
- AndroidBuilder now receives ProjectFlavorHolder and
  BuildTypeHolder. This both contains the flavor/type
  themselves but also implements PathProvider to
  provide the needed path.
- The [ProductFlavor/BuildType]Dimension implements
  the Holder classes to provide those paths
- Moved to using the AndroidBuilder. It is created
  by the ConfigureVariant task and set in the plugin
  through the AndroidBasePlugin (will be used by
  both plugins) and queried by the tasks with a simple
  AndroidBuilderProvider
- Updated the mergeManifest, crunchRes, processRes,
  dex and packageApp tasks to use the AndroidBuilder.

The tasks to create test apps haven't been touched yet.

Known issues:
- AndroidBuilderProvider will not work for builds that
  create more than one APK.
- Because some inputs are not explicit in some tasks
  (they are figured out automatically on the
  AndroidBuilder side, touching some files will not
  trigger new builds. The task's TaskInputs object
  needs to be manipulated to help with this. This
  will be needed for the inputs coming from library
  dependencies as well anyway.

Change-Id: I7f9ca428ce2048ce92ed780367db0aaf01f6350b
39 files changed:
.gitignore
builder/src/main/java/com/android/builder/AaptOptions.java
builder/src/main/java/com/android/builder/AndroidBuilder.java
builder/src/main/java/com/android/builder/BuildType.java
builder/src/main/java/com/android/builder/BuildTypeHolder.java [new file with mode: 0644]
builder/src/main/java/com/android/builder/DefaultSdkParser.java
builder/src/main/java/com/android/builder/DexOptions.java
builder/src/main/java/com/android/builder/PathProvider.java [new file with mode: 0644]
builder/src/main/java/com/android/builder/ProductFlavor.java
builder/src/main/java/com/android/builder/ProductFlavorHolder.java [new file with mode: 0644]
builder/src/main/java/com/android/builder/packaging/DuplicateFileException.java
builder/src/main/java/com/android/builder/signing/DebugKeyHelper.java
builder/src/test/java/com/android/builder/AndroidBuilderTest.java
builder/src/test/java/com/android/builder/BuildTypeHolderMock.java [new file with mode: 0644]
builder/src/test/java/com/android/builder/ProductFlavorHolderMock.java [new file with mode: 0644]
builder/src/test/java/com/android/builder/ProductFlavorTest.java
builder/src/test/java/com/android/builder/samples/DefaultPathProvider.java [new file with mode: 0644]
builder/src/test/java/com/android/builder/samples/Main.java
gradle/src/main/groovy/com/android/build/gradle/AndroidBasePlugin.groovy [new file with mode: 0644]
gradle/src/main/groovy/com/android/build/gradle/AndroidBuilderProvider.groovy [new file with mode: 0644]
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 [new file with mode: 0644]
gradle/src/main/groovy/com/android/build/gradle/AndroidPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/BaseAndroidTask.groovy [new file with mode: 0644]
gradle/src/main/groovy/com/android/build/gradle/ConfigureVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/CrunchResources.groovy
gradle/src/main/groovy/com/android/build/gradle/Dex.groovy
gradle/src/main/groovy/com/android/build/gradle/GenerateBuildConfigTask.groovy [copied from gradle/src/main/groovy/com/android/build/gradle/GenerateManifest.groovy with 51% similarity]
gradle/src/main/groovy/com/android/build/gradle/GenerateTestManifest.groovy [moved from gradle/src/main/groovy/com/android/build/gradle/GenerateManifest.groovy with 86% similarity]
gradle/src/main/groovy/com/android/build/gradle/MergeManifest.groovy [new file with mode: 0644]
gradle/src/main/groovy/com/android/build/gradle/PackageApplication.groovy
gradle/src/main/groovy/com/android/build/gradle/ProcessResources.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/ApplicationVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/BaseDimension.groovy [new file with mode: 0644]
gradle/src/main/groovy/com/android/build/gradle/internal/BuildTypeDimension.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/ProductFlavorDimension.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/ProductionAppVariant.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/TestAppVariant.groovy