зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1440433 - Part 2: Remove ANDROID_APK_{NAME,PACKAGE}. r=jchen
The last APK produced using the ANDROID_APK_* moz.build/Makefile.in mechanism was Robocop, so we can get rid of these now. MozReview-Commit-ID: 9b08ZvvOAoC --HG-- extra : rebase_source : ac4fea057bf6e731b0f26a1b6902f17a7362076d
This commit is contained in:
Родитель
9ec875007d
Коммит
1ff0250889
|
@ -7,13 +7,6 @@
|
||||||
|
|
||||||
ifndef INCLUDED_JAVA_BUILD_MK #{
|
ifndef INCLUDED_JAVA_BUILD_MK #{
|
||||||
|
|
||||||
ifdef JAVAFILES #{
|
|
||||||
GENERATED_DIRS += classes
|
|
||||||
|
|
||||||
export:: classes
|
|
||||||
classes: $(call mkdir_deps,classes)
|
|
||||||
endif #} JAVAFILES
|
|
||||||
|
|
||||||
default_bootclasspath_jars := \
|
default_bootclasspath_jars := \
|
||||||
$(ANDROID_SDK)/android.jar \
|
$(ANDROID_SDK)/android.jar \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
@ -27,91 +20,6 @@ define classpath_template
|
||||||
$(subst $(NULL) ,:,$(strip $(1)))
|
$(subst $(NULL) ,:,$(strip $(1)))
|
||||||
endef
|
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 #{
|
ifdef JAVA_JAR_TARGETS #{
|
||||||
# Arg 1: Output target name with .jar suffix, like jars/jarfile.jar.
|
# Arg 1: Output target name with .jar suffix, like jars/jarfile.jar.
|
||||||
# Intermediate class files are generated in jars/jarfile-classes.
|
# Intermediate class files are generated in jars/jarfile-classes.
|
||||||
|
|
|
@ -1198,7 +1198,7 @@ endif
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Java rules
|
# Java rules
|
||||||
###############################################################################
|
###############################################################################
|
||||||
ifneq (,$(JAVAFILES)$(ANDROID_RESFILES)$(ANDROID_APKNAME)$(JAVA_JAR_TARGETS))
|
ifneq (,$(JAVA_JAR_TARGETS))
|
||||||
include $(MOZILLA_DIR)/config/makefiles/java-build.mk
|
include $(MOZILLA_DIR)/config/makefiles/java-build.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,6 @@ from ..makeutil import Makefile
|
||||||
from mozbuild.shellutil import quote as shell_quote
|
from mozbuild.shellutil import quote as shell_quote
|
||||||
|
|
||||||
MOZBUILD_VARIABLES = [
|
MOZBUILD_VARIABLES = [
|
||||||
b'ANDROID_APK_NAME',
|
|
||||||
b'ANDROID_APK_PACKAGE',
|
|
||||||
b'ANDROID_ASSETS_DIRS',
|
b'ANDROID_ASSETS_DIRS',
|
||||||
b'ANDROID_EXTRA_PACKAGES',
|
b'ANDROID_EXTRA_PACKAGES',
|
||||||
b'ANDROID_EXTRA_RES_DIRS',
|
b'ANDROID_EXTRA_RES_DIRS',
|
||||||
|
@ -143,7 +141,6 @@ MOZBUILD_VARIABLES = [
|
||||||
]
|
]
|
||||||
|
|
||||||
DEPRECATED_VARIABLES = [
|
DEPRECATED_VARIABLES = [
|
||||||
b'ANDROID_RESFILES',
|
|
||||||
b'EXPORT_LIBRARY',
|
b'EXPORT_LIBRARY',
|
||||||
b'EXTRA_LIBS',
|
b'EXTRA_LIBS',
|
||||||
b'HOST_LIBS',
|
b'HOST_LIBS',
|
||||||
|
|
|
@ -1216,14 +1216,6 @@ VARIABLES = {
|
||||||
file.
|
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,
|
'ANDROID_EXTRA_PACKAGES': (StrictOrderingOnAppendList, list,
|
||||||
"""The name of extra Android packages to generate R.java for, like ['org.mozilla.other'].
|
"""The name of extra Android packages to generate R.java for, like ['org.mozilla.other'].
|
||||||
"""),
|
"""),
|
||||||
|
|
|
@ -1054,8 +1054,6 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||||
# desired abstraction of the build definition away from makefiles.
|
# desired abstraction of the build definition away from makefiles.
|
||||||
passthru = VariablePassthru(context)
|
passthru = VariablePassthru(context)
|
||||||
varlist = [
|
varlist = [
|
||||||
'ANDROID_APK_NAME',
|
|
||||||
'ANDROID_APK_PACKAGE',
|
|
||||||
'ANDROID_GENERATED_RESFILES',
|
'ANDROID_GENERATED_RESFILES',
|
||||||
'EXTRA_DSO_LDOPTS',
|
'EXTRA_DSO_LDOPTS',
|
||||||
'RCFILE',
|
'RCFILE',
|
||||||
|
|
Загрузка…
Ссылка в новой задаче