Bug 863445 - Part 1: Make mobile/android/base/Makefile.in generate $(DIST)/fennec_ids.txt. r=jmaher

--HG--
rename : build/mobile/robocop/parse_ids.py => mobile/android/base/fennec-ids-generator.py
This commit is contained in:
Nick Alexander 2013-05-10 18:39:00 -07:00
parent fa75ef17d4
commit e31e2f53cc
5 changed files with 20 additions and 25 deletions

View File

@ -64,7 +64,6 @@ robocop_DEST := $(CURDIR)
robocop_FILES := \
$(TESTPATH)/robocop.ini \
$(TESTPATH)/robocop_autophone.ini \
$(srcdir)/parse_ids.py \
$(NULL)
robocop-deps := $(notdir $(robocop_FILES))

View File

@ -1089,6 +1089,10 @@ 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
@ -1255,6 +1259,9 @@ R.java: $(MOZ_APP_ICON) $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDP
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)

View File

@ -12,27 +12,27 @@ def getFile(filename):
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:
@ -46,7 +46,7 @@ def main(args=sys.argv[1:]):
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)
@ -61,4 +61,3 @@ def main(args=sys.argv[1:]):
if __name__ == "__main__":
main()

View File

@ -65,11 +65,13 @@ RUN_MOCHITEST_REMOTE = \
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
@ -95,7 +97,6 @@ mochitest-remote:
$(RUN_MOCHITEST_REMOTE); \
fi
mochitest-robotium: robotium-id-map
mochitest-robotium: DM_TRANS?=adb
mochitest-robotium:
@if [ ! -f ${MOZ_HOST_BIN}/xpcshell ]; then \
@ -435,17 +436,8 @@ make-stage-dir:
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
endif
stage-reftest: make-stage-dir
$(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package

View File

@ -328,8 +328,6 @@ 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