Fix package renaming.
authorXavier Ducrohet <xav@android.com>
Sat, 16 Mar 2013 01:40:17 +0000 (18:40 -0700)
committerXavier Ducrohet <xav@android.com>
Sat, 16 Mar 2013 01:51:48 +0000 (18:51 -0700)
commit442aae711bec2268711e59d66e01de78e6b114e7
tree178b42b587b765b73c6e353191583de14d762d6f
parente7359ead5b01d2f9ffc4510624faa9062887b83c
Fix package renaming.

The previous mechanism used --rename-manifest-package while letting
the created manifest have the old package name. While this rename
the package entry in the manifest, the resource pool was still
associated to the original package name which made thinkgs awkward.

The new mechanism uses the new feature of the manifest-merger that allows
updating the package name. This means the application is compiled
completely using the new package.
In order to keep the R class sane though, aapt is called with
--custom-package to override only the location of the R class.

Change-Id: I0162dab6ca1cdeaf40e0c92d351f0290f01fd216
16 files changed:
builder/src/main/java/com/android/builder/AndroidBuilder.java
builder/src/main/java/com/android/builder/VariantConfiguration.java
changelog.txt
gradle/src/build-test/groovy/com/android/build/gradle/AutomatedBuildTest.java
gradle/src/device-test/groovy/com/android/build/gradle/DeviceTest.java
gradle/src/main/groovy/com/android/build/gradle/BasePlugin.groovy
gradle/src/main/groovy/com/android/build/gradle/internal/tasks/TestFlavorTask.groovy
gradle/src/main/groovy/com/android/build/gradle/tasks/ProcessAndroidResources.groovy
gradle/src/main/groovy/com/android/build/gradle/tasks/ProcessAppManifest.groovy
tests/pkgOverride/build.gradle [new file with mode: 0644]
tests/pkgOverride/src/instrumentTest/java/com/android/tests/basic/MainTest.java [new file with mode: 0644]
tests/pkgOverride/src/main/AndroidManifest.xml [new file with mode: 0644]
tests/pkgOverride/src/main/java/com/android/tests/basic/Main.java [new file with mode: 0644]
tests/pkgOverride/src/main/res/drawable/icon.png [new file with mode: 0644]
tests/pkgOverride/src/main/res/layout/main.xml [new file with mode: 0644]
tests/pkgOverride/src/main/res/values/strings.xml [new file with mode: 0644]