From 004a34bd29b57a9a89612f43fe65fed34a9ac825 Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Fri, 30 Aug 2013 03:50:02 +0100 Subject: [PATCH] fix errors in test build introduced by renaming the package in AndroidManifest.xml instead, we can customise the build task to add a manifestpackage parameter to aapt this will ONLY rename the package according to android package uniqueness - not any other instances (such as the name of the R resource class, relative class names in the manifest file, etc) see http://stackoverflow.com/a/11084817 and http://www.piwai.info/renaming-android-manifest-package/ for details (we still have a hacky mobile-test-setup/revert - but only to rename the title string now) --- mobile-test-revert | 2 -- mobile-test-setup | 9 +++------ mobile/build.xml | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/mobile-test-revert b/mobile-test-revert index 91105439..9192837f 100755 --- a/mobile-test-revert +++ b/mobile-test-revert @@ -2,7 +2,5 @@ # reverse of mobile-test-setup - reverts the changes made to AndroidManifest.xml and any resource files -mv mobile/AndroidManifest.xml~ mobile/AndroidManifest.xml - mv mobile/res/values/strings.xml~ mobile/res/values/strings.xml diff --git a/mobile-test-setup b/mobile-test-setup index 23534a18..f88d1f05 100755 --- a/mobile-test-setup +++ b/mobile-test-setup @@ -2,14 +2,11 @@ # quick-n-dirty script to rename the mobile build for tests - -# rename the package, so it can be installed alongside the regular build -test -f mobile/AndroidManifest.xml~ || cp mobile/AndroidManifest.xml mobile/AndroidManifest.xml~ -sed -e 's/package="com.cradle.iitc_mobile"/package="com.cradle.iitc_mobile.test"/' mobile/AndroidManifest.xml~ > mobile/AndroidManifest.xml - - # rename the app title test -f mobile/res/values/strings.xml~ || cp mobile/res/values/strings.xml mobile/res/values/strings.xml~ sed -e 's/IITC Mobile/IITCm Test/' mobile/res/values/strings.xml~ > mobile/res/values/strings.xml +# also, you'll need to build with +# ant -Doverride.package.name=com.cradle.iitc_mobile.test ... +# or similar diff --git a/mobile/build.xml b/mobile/build.xml index 5d1f821a..b5dff7df 100644 --- a/mobile/build.xml +++ b/mobile/build.xml @@ -86,6 +86,45 @@ In all cases you must update the value of version-tag below to read 'custom' instead of an integer, in order to avoid having your file be overridden by tools such as "android update project" --> + + + + + + + + + + + + + + + + +