Bug 1086693 - Part 7: Add a Makefile target for updating GeneratedJNIWrappers. r=nalexander, a=lsblakk
authorJames Willcox <snorp@snorp.net>
Thu, 13 Nov 2014 12:47:24 -0600
changeset 233940 2fe98d9bf62bacabc6590a6e4c522a4a755ae5f4
parent 233939 f28a8076587daef8786f297aaf66eed27905eb62
child 233941 bd787c46f1139c5c7fc03da20912847905d849ed
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, lsblakk
bugs1086693
milestone35.0a2
Bug 1086693 - Part 7: Add a Makefile target for updating GeneratedJNIWrappers. r=nalexander, a=lsblakk
mobile/android/base/Makefile.in
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -390,16 +390,26 @@ endef
 $(eval $(call aapt_command,.aapt.nodeps,$(CURDIR)/AndroidManifest.xml FORCE,gecko-nodeps.ap_,gecko-nodeps/,gecko-nodeps/))
 
 fennec_ids.txt: generated/org/mozilla/gecko/R.java fennec-ids-generator.py
 	$(PYTHON) $(topsrcdir)/mobile/android/base/fennec-ids-generator.py -i $< -o $@
 
 # Override the Java settings with some specific android settings
 include $(topsrcdir)/config/android-common.mk
 
+update-generated-wrappers:
+	@mv $(topsrcdir)/widget/android/GeneratedJNIWrappers.cpp $(topsrcdir)/widget/android/GeneratedJNIWrappers.cpp.old
+	@mv $(topsrcdir)/widget/android/GeneratedJNIWrappers.h $(topsrcdir)/widget/android/GeneratedJNIWrappers.h.old
+	@echo old GeneratedJNIWrappers.cpp/h moved to GeneratedJNIWrappers.cpp/h.old
+	@cp $(CURDIR)/jni-stubs.inc $(topsrcdir)/mozglue/android
+	@cp $(CURDIR)/GeneratedJNIWrappers.* $(topsrcdir)/widget/android
+	@echo Updated GeneratedJNIWrappers
+
+.PHONY: update-generated-wrappers
+
 # This target is only used by the Eclipse integration. It rebuilds
 # resources that end up in omni.ja, does most of the packaging step,
 # and then updates omni.ja in place. If you're not using Eclipse, you
 # should be using |mach build mobile/android && mach package|.
 $(abspath $(DIST)/fennec/$(OMNIJAR_NAME)): FORCE
 	$(REPORT_BUILD)
 	$(MAKE) -C ../locales
 	$(MAKE) -C ../chrome
@@ -414,13 +424,13 @@ include $(topsrcdir)/config/android-comm
 libs:: geckoview_resources.zip classes.dex jni-stubs.inc GeneratedJNIWrappers.cpp fennec_ids.txt
 	$(INSTALL) geckoview_resources.zip $(FINAL_TARGET)
 	$(INSTALL) classes.dex $(FINAL_TARGET)
 	@(diff jni-stubs.inc $(topsrcdir)/mozglue/android/jni-stubs.inc >/dev/null && diff GeneratedJNIWrappers.cpp $(topsrcdir)/widget/android/GeneratedJNIWrappers.cpp >/dev/null) || \
 	 (echo '*****************************************************' && \
 	  echo '***   Error: The generated JNI code has changed   ***' && \
 	  echo '* To update generated code in the tree, please run  *' && \
 	  echo && \
-	  echo '  cp $(CURDIR)/jni-stubs.inc $(topsrcdir)/mozglue/android && cp $(CURDIR)/GeneratedJNIWrappers.* $(topsrcdir)/widget/android' && \
+	  echo '  make -C $(CURDIR) update-generated-wrappers' && \
 	  echo && \
 	  echo '* Repeat the build, and check in any changes.       *' && \
 	  echo '*****************************************************' && \
 	  exit 1)