Bug 903528 - Follow-up: Fix build dependencies. a=bustage
authorNick Alexander <nalexander@mozilla.com>
Mon, 24 Feb 2014 23:18:47 -0800
changeset 187644 78e1e8346461ed2a293fd8e69d378cf53811aaae
parent 187643 a7f45c95831d5e96d1b34b6d969639697c73d764
child 187645 053ed9efd81bea92f4f529378a86b0b7462c687e
push idunknown
push userunknown
push dateunknown
reviewersbustage
bugs903528
milestone30.0a1
Bug 903528 - Follow-up: Fix build dependencies. a=bustage The issue is that the preprocessed files need to be referenced as $(CURDIR)/file to have Make handle the dependencies correctly. To allow this, this patch adds ANDROID_MANIFEST_FILE (defaulting to AndroidManifest.xml) and uses it in the appropriate places.
build/mobile/robocop/Makefile.in
config/makefiles/java-build.mk
mobile/android/tests/background/junit3/Makefile.in
mobile/android/tests/browser/junit3/Makefile.in
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -40,16 +40,17 @@ java-tests   := \
 PP_TARGETS         += testconstants
 testconstants-dep  := $(dir-tests)/TestConstants.java
 testconstants      := $(TESTPATH)/TestConstants.java.in
 testconstants_PATH := $(dir-tests)
 
 PP_TARGETS        += manifest
 manifest          := $(srcdir)/AndroidManifest.xml.in
 manifest_TARGET   := AndroidManifest.xml
+ANDROID_MANIFEST_FILE := $(CURDIR)/AndroidManifest.xml
 
 # Install robocop configs and helper
 INSTALL_TARGETS += robocop
 robocop_TARGET  := libs
 robocop_DEST    := $(CURDIR)
 robocop_FILES   := \
   $(TESTPATH)/robocop.ini \
   $(TESTPATH)/robocop_autophone.ini \
--- a/config/makefiles/java-build.mk
+++ b/config/makefiles/java-build.mk
@@ -14,16 +14,17 @@ export:: classes
 classes: $(call mkdir_deps,classes)
 endif #} JAVAFILES
 
 
 ifdef ANDROID_APK_NAME #{
 android_res_dirs := $(addprefix $(srcdir)/,$(or $(ANDROID_RES_DIRS),res))
 _ANDROID_RES_FLAG := $(addprefix -S ,$(android_res_dirs))
 _ANDROID_ASSETS_FLAG := $(addprefix -A ,$(ANDROID_ASSETS_DIR))
+android_manifest := $(or $(ANDROID_MANIFEST_FILE),AndroidManifest.xml)
 
 GENERATED_DIRS += classes
 
 classes.dex: $(call mkdir_deps,classes)
 classes.dex: R.java
 classes.dex: $(ANDROID_APK_NAME).ap_
 classes.dex: $(ANDROID_EXTRA_JARS)
 classes.dex: $(JAVAFILES)
@@ -36,17 +37,17 @@ classes.dex: $(JAVAFILES)
 
 R.java: .aapt.deps
 $(ANDROID_APK_NAME).ap_: .aapt.deps
 
 # This uses the fact that Android resource directories list all
 # resource files one subdirectory below the parent resource directory.
 android_res_files := $(wildcard $(addsuffix /*,$(wildcard $(addsuffix /*,$(android_res_dirs)))))
 
-.aapt.deps: AndroidManifest.xml $(android_res_files) $(wildcard $(ANDROID_ASSETS_DIR))
+.aapt.deps: $(android_manifest) $(android_res_files) $(wildcard $(ANDROID_ASSETS_DIR))
 	$(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar $(_ANDROID_RES_FLAG) $(_ANDROID_ASSETS_FLAG) \
 		-J ${@D} \
 		-F $(ANDROID_APK_NAME).ap_
 	@$(TOUCH) $@
 
 $(ANDROID_APK_NAME)-unsigned-unaligned.apk: $(ANDROID_APK_NAME).ap_ classes.dex
 	cp $< $@
 	$(ZIP) -0 $@ classes.dex
--- a/mobile/android/tests/background/junit3/Makefile.in
+++ b/mobile/android/tests/background/junit3/Makefile.in
@@ -9,16 +9,17 @@ manifest          := $(srcdir)/AndroidMa
 manifest_TARGET   := AndroidManifest.xml
 manifest_FLAGS    += \
   -DANDROID_BACKGROUND_TARGET_PACKAGE_NAME='$(ANDROID_PACKAGE_NAME)' \
   -DANDROID_BACKGROUND_TEST_PACKAGE_NAME='org.mozilla.gecko.background.tests' \
   -DANDROID_BACKGROUND_APP_DISPLAYNAME='$(MOZ_APP_DISPLAYNAME) Background Tests' \
   -DMOZ_ANDROID_SHARED_ID='$(ANDROID_PACKAGE_NAME).sharedID' \
   -DMOZ_ANDROID_SHARED_ACCOUNT_TYPE='$(ANDROID_PACKAGE_NAME)_sync' \
   $(NULL)
+ANDROID_MANIFEST_FILE := $(CURDIR)/AndroidManifest.xml
 
 GARBAGE += AndroidManifest.xml
 
 include $(srcdir)/android-services-files.mk
 
 # BACKGROUND_TESTS_{JAVA,RES}_FILES are defined in android-services-files.mk.
 JAVAFILES := $(BACKGROUND_TESTS_JAVA_FILES)
 
--- a/mobile/android/tests/browser/junit3/Makefile.in
+++ b/mobile/android/tests/browser/junit3/Makefile.in
@@ -11,16 +11,17 @@ ANDROID_EXTRA_JARS += \
 PP_TARGETS += manifest
 manifest := AndroidManifest.xml.in
 manifest_FLAGS += \
   -DANDROID_BROWSER_TARGET_PACKAGE_NAME='$(ANDROID_PACKAGE_NAME)' \
   -DANDROID_BROWSER_TEST_PACKAGE_NAME='org.mozilla.gecko.browser.tests' \
   -DANDROID_BROWSER_APP_DISPLAYNAME='$(MOZ_APP_DISPLAYNAME) Browser Tests' \
   -DMOZ_ANDROID_SHARED_ID='$(ANDROID_PACKAGE_NAME).sharedID' \
   $(NULL)
+ANDROID_MANIFEST_FILE := $(CURDIR)/AndroidManifest.xml
 
 include $(topsrcdir)/config/rules.mk
 
 tools:: $(ANDROID_APK_NAME).apk
 
 # The test APK needs to know the contents of the target APK while not
 # being linked against them.  This is a best effort to avoid getting
 # out of sync with base's build config.