Bug 863445 - Part 1: Make mobile/android/base/Makefile.in generate $(DIST)/fennec_ids.txt. r=jmaher
☠☠ backed out by 2e6cfac714f6 ☠ ☠
authorNick Alexander <nalexander@mozilla.com>
Sat, 11 May 2013 16:53:48 -0700
changeset 142605 2d5c2f19192085903b3d024e3f8530596bd61d18
parent 142604 dec449c6ac152d0a456656b388cc504bb02a570f
child 142606 611c81436abea784c03905f66711a14ca8e914b5
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs863445
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 863445 - Part 1: Make mobile/android/base/Makefile.in generate $(DIST)/fennec_ids.txt. r=jmaher
build/mobile/robocop/Makefile.in
build/mobile/robocop/parse_ids.py
mobile/android/base/Makefile.in
mobile/android/base/fennec-ids-generator.py
testing/testsuite-targets.mk
toolkit/mozapps/installer/packager.mk
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -59,17 +59,16 @@ manifest_TARGET   := 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 \
-  $(srcdir)/parse_ids.py \
   $(NULL)
 robocop-deps := $(notdir $(robocop_FILES))
 
 MOCHITEST_ROBOCOP_FILES := \
   $(wildcard $(TESTPATH)/*.html) \
   $(wildcard $(TESTPATH)/*.jpg) \
   $(wildcard $(TESTPATH)/*.sjs) \
   $(wildcard $(TESTPATH)/test*.js) \
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1098,16 +1098,20 @@ ALL_JARS = \
   jars/sync-thirdparty.jar \
   jars/gecko-mozglue.jar \
   $(NULL)
 
 ifdef MOZ_WEBRTC
 ALL_JARS += jars/webrtc.jar
 endif
 
+INSTALL_TARGETS += fennec_ids
+fennec_ids_FILES := fennec_ids.txt
+fennec_ids_DEST := $(DIST)
+
 include $(topsrcdir)/config/rules.mk
 
 # Override the Java settings with some specific android settings
 include $(topsrcdir)/config/android-common.mk
 
 # Note that we're going to set up a dependency directly between embed_android.dex and the java files
 # Instead of on the .class files, since more than one .class file might be produced per .java file
 # Sync dependencies are provided in a single jar. Sync classes themselves are delivered as source,
@@ -1264,13 +1268,16 @@ RES_BRANDING_DRAWABLE_MDPI = $(addprefix
 
 
 R.java: $(MOZ_APP_ICON) $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(PP_RES_XML) res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png res/values/strings.xml AndroidManifest.xml FORCE
 	$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -J . --custom-package org.mozilla.gecko
 
 gecko.ap_: AndroidManifest.xml res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(PP_RES_XML) res/values/strings.xml FORCE
 	$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar  -S res -F $@
 
+fennec_ids.txt: fennec-ids-generator.py R.java
+	$(PYTHON) $(topsrcdir)/mobile/android/base/fennec-ids-generator.py -i R.java -o $@
+
 libs:: classes.dex package-name.txt jni-stubs.inc
 	$(INSTALL) classes.dex $(FINAL_TARGET)
 	$(INSTALL) package-name.txt $(FINAL_TARGET)
 	@(diff jni-stubs.inc $(topsrcdir)/mozglue/android/jni-stubs.inc >/dev/null) || \
 	 (echo "*** Error: The jni-stubs have changed. Copy $(CURDIR)/jni-stubs.inc to $(topsrcdir)/mozglue/android" && exit 1)
rename from build/mobile/robocop/parse_ids.py
rename to mobile/android/base/fennec-ids-generator.py
--- a/build/mobile/robocop/parse_ids.py
+++ b/mobile/android/base/fennec-ids-generator.py
@@ -7,58 +7,57 @@ import os
 import sys
 import optparse
 
 def getFile(filename):
   fHandle = open(filename, 'r')
   data = fHandle.read()
   fHandle.close()
   return data
-  
+
 def findIDs(data):
   start_function = False
   reID = re.compile('.*public static final class id {.*')
   reEnd = re.compile('.*}.*')
   idlist = []
-  
+
   for line in data.split('\n'):
     if reEnd.match(line):
       start_function = False
-      
+
     if start_function:
       id_value = line.split(' ')[-1]
       idlist.append(id_value.split(';')[0].split('='))
-      
+
     if reID.match(line):
       start_function = True
-      
+
   return idlist
-  
-  
+
+
 def printIDs(outputFile, idlist):
   fOutput = open(outputFile, 'w')
   for item in idlist:
     fOutput.write("%s=%s\n" % (item[0], item[1]))
   fOutput.close()
 
 def main(args=sys.argv[1:]):
   parser = optparse.OptionParser()
   parser.add_option('-o', '--output', dest='outputFile', default='',
                     help="output file with the id=value pairs")
   parser.add_option('-i', '--input', dest='inputFile', default='',
                     help="filename of the input R.java file")
   options, args = parser.parse_args(args)
-  
+
   if options.inputFile == '':
     print "Error: please provide input file: -i <filename>"
     sys.exit(1)
 
   if options.outputFile == '':
     print "Error: please provide output file: -o <filename>"
     sys.exit(1)
 
   data = getFile(os.path.abspath(options.inputFile));
   idlist = findIDs(data)
   printIDs(os.path.abspath(options.outputFile), idlist)
 
 if __name__ == "__main__":
     main()
-
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -60,21 +60,23 @@ RUN_MOCHITEST_REMOTE = \
   $(PYTHON) _tests/testing/mochitest/runtestsremote.py --autorun --close-when-done \
     --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \
     --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
     --testing-modules-dir=$(call core_abspath,_tests/modules) \
     $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
 
 RUN_MOCHITEST_ROBOTIUM = \
   rm -f ./$@.log && \
-  $(PYTHON) _tests/testing/mochitest/runtestsremote.py --robocop-path=$(DEPTH)/dist \
-    --robocop-ids=$(DEPTH)/build/mobile/robocop/fennec_ids.txt \
+  $(PYTHON) _tests/testing/mochitest/runtestsremote.py \
+    --robocop-path=$(DIST) \
+    --robocop-ids=$(DIST)/fennec_ids.txt \
+    --robocop=$(DEPTH)/build/mobile/robocop/robocop.ini \
     --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \
     --app=$(TEST_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \
-    --robocop=$(DEPTH)/build/mobile/robocop/robocop.ini $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
+    $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS)
 
 ifndef NO_FAIL_ON_TEST_ERRORS
 define check_test_error_internal
   @errors=`grep "TEST-UNEXPECTED-" $@.log` ;\
   if test "$$errors" ; then \
 	  echo "$@ failed:"; \
 	  echo "$$errors"; \
           $(if $(1),echo $(1)) \
@@ -90,17 +92,16 @@ mochitest-remote:
 	@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
         echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
     elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
         echo "please prepare your host with the environment variable TEST_DEVICE"; \
     else \
         $(RUN_MOCHITEST_REMOTE); \
     fi
 
-mochitest-robotium: robotium-id-map
 mochitest-robotium: DM_TRANS?=adb
 mochitest-robotium:
 	@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
         echo "please prepare your host with the environment variable MOZ_HOST_BIN"; \
     elif [ "${TEST_DEVICE}" = "" -a "$(DM_TRANS)" != "adb" ]; then \
         echo "please prepare your host with the environment variable TEST_DEVICE"; \
     else \
         $(RUN_MOCHITEST_ROBOTIUM); \
@@ -430,26 +431,20 @@ make-stage-dir:
 	$(NSINSTALL) -D $(PKG_STAGE)/jetpack
 	$(NSINSTALL) -D $(PKG_STAGE)/peptest
 	$(NSINSTALL) -D $(PKG_STAGE)/mozbase
 	$(NSINSTALL) -D $(PKG_STAGE)/modules
 
 stage-b2g: make-stage-dir
 	$(NSINSTALL) $(topsrcdir)/b2g/test/b2g-unittest-requirements.txt $(PKG_STAGE)/b2g
 
-robotium-id-map:
-ifeq ($(MOZ_BUILD_APP),mobile/android)
-	$(PYTHON) $(DEPTH)/build/mobile/robocop/parse_ids.py -i $(DEPTH)/mobile/android/base/R.java -o $(DEPTH)/build/mobile/robocop/fennec_ids.txt
-endif
-
-stage-mochitest: robotium-id-map
 stage-mochitest: make-stage-dir
 	$(MAKE) -C $(DEPTH)/testing/mochitest stage-package
 ifeq ($(MOZ_BUILD_APP),mobile/android)
-	$(NSINSTALL) $(DEPTH)/build/mobile/robocop/fennec_ids.txt $(PKG_STAGE)/mochitest
+	$(NSINSTALL) $(DIST)/fennec_ids.txt $(PKG_STAGE)/mochitest
 endif
 
 stage-reftest: make-stage-dir
 	$(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package
 
 stage-xpcshell: make-stage-dir
 	$(MAKE) -C $(DEPTH)/testing/xpcshell stage-package
 
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -323,18 +323,16 @@ GECKO_APP_AP_PATH = $(call core_abspath,
 
 ifdef ENABLE_TESTS
 INNER_ROBOCOP_PACKAGE=echo
 ifeq ($(MOZ_BUILD_APP),mobile/android)
 UPLOAD_EXTRA_FILES += robocop.apk
 UPLOAD_EXTRA_FILES += fennec_ids.txt
 ROBOCOP_PATH = $(call core_abspath,$(_ABS_DIST)/../build/mobile/robocop)
 INNER_ROBOCOP_PACKAGE= \
-  $(PYTHON) $(abspath $(topsrcdir)/build/mobile/robocop/parse_ids.py) -i $(call core_abspath,$(DEPTH)/mobile/android/base/R.java) -o $(call core_abspath,$(DEPTH)/build/mobile/robocop/fennec_ids.txt) && \
-  $(NSINSTALL) $(call core_abspath,$(DEPTH)/build/mobile/robocop/fennec_ids.txt) $(_ABS_DIST) && \
   $(APKBUILDER) $(_ABS_DIST)/robocop-raw.apk -v $(APKBUILDER_FLAGS) -z $(ROBOCOP_PATH)/robocop.ap_ -f $(ROBOCOP_PATH)/classes.dex && \
   $(JARSIGNER) $(_ABS_DIST)/robocop-raw.apk && \
   $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/robocop-raw.apk $(_ABS_DIST)/robocop.apk
 endif
 else
 INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Robocop for you'
 endif