Improvements to SigningConfig/BuildType initialization.
authorXavier Ducrohet <xav@android.com>
Wed, 16 Jan 2013 03:12:28 +0000 (19:12 -0800)
committerXavier Ducrohet <xav@android.com>
Wed, 16 Jan 2013 19:34:22 +0000 (11:34 -0800)
commitd95ed4c46ac51c7942c045d08a948c7b53af764c
tree94374b2eff1f8bdc170ec0fc3a03236be96a4f67
parent2a74e79306e335177467528f1b4336756b7d89a5
Improvements to SigningConfig/BuildType initialization.

Moved the init code out of the main classes in Builder and into
the Dsl children classes.

This fixes some issues around sharing the SigningConfig.debug
object instead of creating a new disconnected one, so that
customizing it does update the BuildType.debug object.

This also improve error handling so that Builder doesn't
throw a RuntimeException but the Gradle plugin can (actually
a BuildException) if the debug keystore path cannot be found.
It's better that the client of the Builder library decides
what to do instead of the library throwing.

Also added debug signing config customization support in the
library plugin.

Finally added a initWith() method to both SigningConfig and
BuildType to allow easy duplication from the DSL.
Will probably need to do the same for ProductFlavor.

Change-Id: I931be800f42346899655d66631029b7f4acc42a2
16 files changed:
builder/src/main/java/com/android/builder/BuildType.java
builder/src/main/java/com/android/builder/BuilderConstants.java
builder/src/main/java/com/android/builder/ProductFlavor.java
builder/src/main/java/com/android/builder/SigningConfig.java
builder/src/main/java/com/android/builder/VariantConfiguration.java
builder/src/test/java/com/android/builder/BuildTypeTest.java [deleted file]
gradle/src/main/groovy/com/android/build/gradle/AppPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/LibraryExtension.groovy
gradle/src/main/groovy/com/android/build/gradle/LibraryPlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/dsl/BuildTypeDsl.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/dsl/SigningConfigDsl.java [new file with mode: 0644]
gradle/src/main/groovy/com/android/build/gradle/internal/dsl/SigningConfigFactory.groovy
gradle/src/test/groovy/com/android/build/gradle/AppPluginInternalTest.groovy
gradle/src/test/groovy/com/android/build/gradle/LibraryPluginDslTest.groovy
gradle/src/test/groovy/com/android/build/gradle/internal/dsl/BuildTypeDslTest.groovy [new file with mode: 0644]
gradle/src/test/groovy/com/android/build/gradle/internal/dsl/SigningConfigDslTest.java [new file with mode: 0644]