Bug 969925 - Generate an empty fennec_ids.txt. r=gbrown
authorNick Alexander <nalexander@mozilla.com>
Mon, 15 Jun 2015 11:34:51 -0700
changeset 248935 59851463cc094045b0a59ab8b3a762aad501e06c
parent 248934 c418add0c07f124d074425dab9404399897f6cd7
child 248936 8994807084909510168256f026700469f6b55fbf
push id28913
push usercbook@mozilla.com
push dateTue, 16 Jun 2015 13:53:56 +0000
treeherdermozilla-central@95b628befd28 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs969925
milestone41.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 969925 - Generate an empty fennec_ids.txt. r=gbrown Automation and some third-party tooling expects fennec_ids.txt, but an empty file should suffice.
mobile/android/base/Makefile.in
mobile/android/base/fennec-ids-generator.py
mobile/android/base/fennec_ids.txt.in
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -39,17 +39,16 @@ GARBAGE += \
   AndroidManifest.xml  \
   WebappManifestFragment.xml.frag \
   classes.dex  \
   gecko.ap_  \
   res/values/strings.xml \
   res/raw/browsersearch.json \
   res/raw/suggestedsites.json \
   .aapt.deps \
-  fennec_ids.txt \
   javah.out \
   jni-stubs.inc \
   GeneratedJNIWrappers.cpp \
   GeneratedJNIWrappers.h \
   $(NULL)
 
 GARBAGE_DIRS += classes db jars res sync services generated
 
@@ -231,16 +230,17 @@ ANNOTATION_PROCESSOR_JAR_FILES := $(DEPT
 
 GeneratedJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES)
 GeneratedJNIWrappers.cpp: $(ALL_JARS)
 	$(JAVA) -classpath gecko-mozglue.jar:$(JAVA_BOOTCLASSPATH):$(JAVA_CLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $(ALL_JARS)
 
 manifest := \
   AndroidManifest.xml.in \
   WebappManifestFragment.xml.frag.in \
+  fennec_ids.txt.in \
   $(NULL)
 
 PP_TARGETS += manifest
 
 # Certain source files need to be preprocessed.  This special rule
 # generates these files into generated/org/mozilla/gecko for
 # consumption by the build system and IDEs.
 
@@ -444,19 +444,16 @@ endef
 # toolkit/mozapps/installer/packager.mk.
 
 # .aapt.deps: $(all_resources)
 $(eval $(call aapt_command,.aapt.deps,$(all_resources),gecko.ap_,generated/,./))
 
 # .aapt.nodeps: $(CURDIR)/AndroidManifest.xml FORCE
 $(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
@@ -483,17 +480,17 @@ update-generated-wrappers:
 
 # Targets built very early during a Gradle build.
 gradle-targets: .aapt.deps
 
 gradle-omnijar: $(abspath $(DIST)/fennec/$(OMNIJAR_NAME))
 
 .PHONY: gradle-targets gradle-omnijar
 
-libs:: geckoview_resources.zip classes.dex jni-stubs.inc GeneratedJNIWrappers.cpp fennec_ids.txt
+libs:: geckoview_resources.zip classes.dex jni-stubs.inc GeneratedJNIWrappers.cpp $(CURDIR)/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 '  make -C $(CURDIR) update-generated-wrappers' && \
deleted file mode 100644
--- a/mobile/android/base/fennec-ids-generator.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import re
-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()
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/fennec_ids.txt.in
@@ -0,0 +1,2 @@
+#filter slashslash
+// fennec_ids.txt needs to exist (for automation) but contains no content.