diff --git a/config/makefiles/java-build.mk b/config/makefiles/java-build.mk index bf667ac446f5..0ebb16f217f4 100644 --- a/config/makefiles/java-build.mk +++ b/config/makefiles/java-build.mk @@ -7,13 +7,6 @@ ifndef INCLUDED_JAVA_BUILD_MK #{ -ifdef JAVAFILES #{ -GENERATED_DIRS += classes - -export:: classes -classes: $(call mkdir_deps,classes) -endif #} JAVAFILES - default_bootclasspath_jars := \ $(ANDROID_SDK)/android.jar \ $(NULL) @@ -27,91 +20,6 @@ define classpath_template $(subst $(NULL) ,:,$(strip $(1))) endef -ifdef ANDROID_APK_NAME #{ -$(if $(ANDROID_APK_PACKAGE),,$(error Missing ANDROID_APK_PACKAGE with ANDROID_APK_NAME)) - -android_res_dirs := $(or $(ANDROID_RES_DIRS),$(srcdir)/res) -_ANDROID_RES_FLAG := $(addprefix -S ,$(android_res_dirs)) -_ANDROID_ASSETS_FLAG := $(if $(ANDROID_ASSETS_DIRS),$(addprefix -A ,$(ANDROID_ASSETS_DIRS))) -android_manifest := $(or $(ANDROID_MANIFEST_FILE),AndroidManifest.xml) - -GENERATED_DIRS += classes generated - -generated_r_java := generated/$(subst .,/,$(ANDROID_APK_PACKAGE))/R.java - -classes.dex: $(call mkdir_deps,classes) -classes.dex: $(generated_r_java) -classes.dex: $(ANDROID_APK_NAME).ap_ -classes.dex: $(default_classpath_jars) $(ANDROID_CLASSPATH_JARS) -classes.dex: $(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS) $(ANDROID_EXTRA_JARS) -classes.dex: $(JAVAFILES) - $(JAVAC) $(JAVAC_FLAGS) -d classes $(filter %.java,$^) \ - $(addprefix -bootclasspath ,$(call classpath_template,$(default_bootclasspath_jars) $(ANDROID_BOOTCLASSPATH_JARS))) \ - $(addprefix -classpath ,$(call classpath_template,$(default_classpath_jars) $(ANDROID_CLASSPATH_JARS) $(ANDROID_EXTRA_JARS))) - $(DX) --dex --output=$@ classes $(ANDROID_EXTRA_JARS) - -# R.java and $(ANDROID_APK_NAME).ap_ are both produced by aapt. To -# save an aapt invocation, we produce them both at the same time. The -# trailing semi-colon defines an empty recipe; defining no recipe at -# all causes Make to treat the target differently, in a way that -# defeats our dependencies. - -$(generated_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))))) - -# An extra package like org.example.app generates dependencies like: -# generated/org/example/app/R.java: .aapt.deps ; -# classes.dex: generated/org/example/app/R.java -# GARBAGE: generated/org/example/app/R.java -$(foreach extra_package,$(ANDROID_EXTRA_PACKAGES), \ - $(eval generated/$(subst .,/,$(extra_package))/R.java: .aapt.deps ;) \ - $(eval classes.dex: generated/$(subst .,/,$(extra_package))/R.java) \ - $(eval GARBAGE: generated/$(subst .,/,$(extra_package))/R.java) \ -) - -# aapt flag -m: 'make package directories under location specified by -J'. -# The --extra-package list is colon separated. -.aapt.deps: $(android_manifest) $(android_res_files) $(wildcard $(ANDROID_ASSETS_DIRS)) - @$(TOUCH) $@ - $(AAPT) package -f -M $< -I $(ANDROID_SDK)/android.jar $(_ANDROID_RES_FLAG) $(_ANDROID_ASSETS_FLAG) \ - --custom-package $(ANDROID_APK_PACKAGE) \ - --non-constant-id \ - --auto-add-overlay \ - $(if $(ANDROID_EXTRA_PACKAGES),--extra-packages $(subst $(NULL) ,:,$(strip $(ANDROID_EXTRA_PACKAGES)))) \ - $(if $(ANDROID_EXTRA_RES_DIRS),$(addprefix -S ,$(ANDROID_EXTRA_RES_DIRS))) \ - -m \ - -J ${@D}/generated \ - -F $(ANDROID_APK_NAME).ap_ - -$(ANDROID_APK_NAME)-unsigned-unaligned.apk: $(ANDROID_APK_NAME).ap_ classes.dex - cp $< $@ - $(ZIP) -0 $@ classes.dex - -$(ANDROID_APK_NAME)-unaligned.apk: $(ANDROID_APK_NAME)-unsigned-unaligned.apk - cp $< $@ - $(DEBUG_JARSIGNER) $@ - -$(ANDROID_APK_NAME).apk: $(ANDROID_APK_NAME)-unaligned.apk - $(ZIPALIGN) -f 4 $< $@ - -GARBAGE += \ - $(generated_r_java) \ - classes.dex \ - $(ANDROID_APK_NAME).ap_ \ - $(ANDROID_APK_NAME)-unsigned-unaligned.apk \ - $(ANDROID_APK_NAME)-unaligned.apk \ - $(ANDROID_APK_NAME).apk \ - $(NULL) - -# Include Android specific java flags, instead of what's in rules.mk. -include $(topsrcdir)/config/android-common.mk -endif #} ANDROID_APK_NAME - - ifdef JAVA_JAR_TARGETS #{ # Arg 1: Output target name with .jar suffix, like jars/jarfile.jar. # Intermediate class files are generated in jars/jarfile-classes. diff --git a/config/rules.mk b/config/rules.mk index 8054268dd3e0..eb86b0c6379a 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -1198,7 +1198,7 @@ endif ############################################################################### # Java rules ############################################################################### -ifneq (,$(JAVAFILES)$(ANDROID_RESFILES)$(ANDROID_APKNAME)$(JAVA_JAR_TARGETS)) +ifneq (,$(JAVA_JAR_TARGETS)) include $(MOZILLA_DIR)/config/makefiles/java-build.mk endif diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index 5192d45dd263..c1bbce7e4e2d 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -86,8 +86,6 @@ from ..makeutil import Makefile from mozbuild.shellutil import quote as shell_quote MOZBUILD_VARIABLES = [ - b'ANDROID_APK_NAME', - b'ANDROID_APK_PACKAGE', b'ANDROID_ASSETS_DIRS', b'ANDROID_EXTRA_PACKAGES', b'ANDROID_EXTRA_RES_DIRS', @@ -143,7 +141,6 @@ MOZBUILD_VARIABLES = [ ] DEPRECATED_VARIABLES = [ - b'ANDROID_RESFILES', b'EXPORT_LIBRARY', b'EXTRA_LIBS', b'HOST_LIBS', diff --git a/python/mozbuild/mozbuild/frontend/context.py b/python/mozbuild/mozbuild/frontend/context.py index 77406404e721..6e1adf7237b0 100644 --- a/python/mozbuild/mozbuild/frontend/context.py +++ b/python/mozbuild/mozbuild/frontend/context.py @@ -1216,14 +1216,6 @@ VARIABLES = { file. """), - 'ANDROID_APK_NAME': (unicode, unicode, - """The name of an Android APK file to generate. - """), - - 'ANDROID_APK_PACKAGE': (unicode, unicode, - """The name of the Android package to generate R.java for, like org.mozilla.gecko. - """), - 'ANDROID_EXTRA_PACKAGES': (StrictOrderingOnAppendList, list, """The name of extra Android packages to generate R.java for, like ['org.mozilla.other']. """), diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index 9546e41a5b67..b866c62b8925 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -1054,8 +1054,6 @@ class TreeMetadataEmitter(LoggingMixin): # desired abstraction of the build definition away from makefiles. passthru = VariablePassthru(context) varlist = [ - 'ANDROID_APK_NAME', - 'ANDROID_APK_PACKAGE', 'ANDROID_GENERATED_RESFILES', 'EXTRA_DSO_LDOPTS', 'RCFILE',