Bug 1443332 - Fold APK signing from android-common.mk into upload-files-APK.mk. r=firefox-build-system-reviewers,mshal
authorNick Alexander <nalexander@mozilla.com>
Wed, 03 Oct 2018 18:05:27 +0000
changeset 495175 6e222901deec3664a599bf754f246b1e05f501a8
parent 495174 8427d9f7e96a4af62562b697055f294b1e0ab2cb
child 495176 54476b60b2ab61e0582196a47181f096672ee9f1
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, mshal
bugs1443332
milestone64.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 1443332 - Fold APK signing from android-common.mk into upload-files-APK.mk. r=firefox-build-system-reviewers,mshal This merely centralizes logic that was formerly used at multiple sites into the single remaining use site. None of the JAVA* flags have been used for a long time. Differential Revision: https://phabricator.services.mozilla.com/D7313
config/android-common.mk
config/config.mk
mobile/android/base/Makefile.in
toolkit/mozapps/installer/upload-files-APK.mk
deleted file mode 100644
--- a/config/android-common.mk
+++ /dev/null
@@ -1,51 +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/.
-
-# Ensure ANDROID_SDK is defined before including this file.
-# We use common android defaults for boot class path and java version.
-ifndef ANDROID_SDK
-  $(error ANDROID_SDK must be defined before including android-common.mk)
-endif
-
-# DEBUG_JARSIGNER always debug signs.
-DEBUG_JARSIGNER=$(PYTHON) $(abspath $(topsrcdir)/mobile/android/debug_sign_tool.py) \
-  --keytool=$(KEYTOOL) \
-  --jarsigner=$(JARSIGNER) \
-  $(NULL)
-
-# RELEASE_JARSIGNER release signs if possible.
-ifdef MOZ_SIGN_CMD
-RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar
-else
-RELEASE_JARSIGNER := $(DEBUG_JARSIGNER)
-endif
-
-# $(1) is the full path to input:  foo-debug-unsigned-unaligned.apk.
-# $(2) is the full path to output: foo.apk.
-# Use this like: $(call RELEASE_SIGN_ANDROID_APK,foo-debug-unsigned-unaligned.apk,foo.apk)
-#
-# The |zip -d| there to handle re-signing previously signed APKs.  Gradle
-# produces signed, unaligned APK files, but this expects unsigned, unaligned
-# APK files.  The |zip -d| discards any existing signature, turning a signed,
-# unaligned APK into an unsigned, unaligned APK.  Sadly |zip -q| doesn't
-# silence a warning about "nothing to do" so we pipe to /dev/null.
-RELEASE_SIGN_ANDROID_APK = \
-  cp $(1) $(2)-unaligned.apk && \
-  ($(ZIP) -d $(2)-unaligned.apk 'META-INF/*' > /dev/null || true) && \
-  $(RELEASE_JARSIGNER) $(2)-unaligned.apk && \
-  $(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \
-  $(RM) $(2)-unaligned.apk
-
-# For Android, we default to 1.7
-ifndef JAVA_VERSION
-  JAVA_VERSION = 1.7
-endif
-
-JAVAC_FLAGS = \
-  -target $(JAVA_VERSION) \
-  -source $(JAVA_VERSION) \
-  -encoding UTF8 \
-  -g:source,lines \
-  -Werror \
-  $(NULL)
--- a/config/config.mk
+++ b/config/config.mk
@@ -409,27 +409,16 @@ else
 MERGE_FILE = $(LOCALE_SRCDIR)/$(1)
 MERGE_RELATIVE_FILE = $(call EXPAND_LOCALE_SRCDIR,$(2))/$(1)
 endif
 
 ifneq (WINNT,$(OS_ARCH))
 RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
 endif # ! WINNT
 
-#
-# Java macros
-#
-
-# Make sure any compiled classes work with at least JVM 1.4
-JAVAC_FLAGS += -source 1.4
-
-ifdef MOZ_DEBUG
-JAVAC_FLAGS += -g
-endif
-
 # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
 # this file
 OBJ_SUFFIX := $(_OBJ_SUFFIX)
 
 OBJS_VAR_SUFFIX := OBJS
 
 # PGO builds with GCC and clang-cl build objects with instrumentation in
 # a first pass, then objects optimized, without instrumentation, in a
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -25,19 +25,16 @@ chrome-%:: AB_CD=$*
 chrome-%::
 	$(MAKE) \
 	  res/values$(AB_rCD)/strings.xml \
 	  res/raw$(AB_rCD)/suggestedsites.json \
 	  AB_CD=$*
 
 include $(topsrcdir)/config/rules.mk
 
-# Override the Java settings with some specific android settings
-include $(topsrcdir)/config/android-common.mk
-
 # This target is only used by IDE integrations. It rebuilds resources
 # that end up in omni.ja using the equivalent of |mach build faster|,
 # does most of the packaging step, and then updates omni.ja in
 # place. If you're not using an IDE, you should be using |mach build
 # mobile/android && mach package|.
 $(ABS_DIST)/fennec/$(OMNIJAR_NAME): FORCE
 	$(REPORT_BUILD)
 	$(MAKE) -C ../../../faster
--- a/toolkit/mozapps/installer/upload-files-APK.mk
+++ b/toolkit/mozapps/installer/upload-files-APK.mk
@@ -1,17 +1,44 @@
 # 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/.
 
 # This file should ONLY be included from upload-files.mk. It was
 # split into its own file to increase comprehension of
 # upload-files.mk.
 
-include $(MOZILLA_DIR)/config/android-common.mk
+# DEBUG_JARSIGNER always debug signs.
+DEBUG_JARSIGNER=$(PYTHON) $(abspath $(topsrcdir)/mobile/android/debug_sign_tool.py) \
+  --keytool=$(KEYTOOL) \
+  --jarsigner=$(JARSIGNER) \
+  $(NULL)
+
+# RELEASE_JARSIGNER release signs if possible.
+ifdef MOZ_SIGN_CMD
+RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar
+else
+RELEASE_JARSIGNER := $(DEBUG_JARSIGNER)
+endif
+
+# $(1) is the full path to input:  foo-debug-unsigned-unaligned.apk.
+# $(2) is the full path to output: foo.apk.
+# Use this like: $(call RELEASE_SIGN_ANDROID_APK,foo-debug-unsigned-unaligned.apk,foo.apk)
+#
+# The |zip -d| there to handle re-signing previously signed APKs.  Gradle
+# produces signed, unaligned APK files, but this expects unsigned, unaligned
+# APK files.  The |zip -d| discards any existing signature, turning a signed,
+# unaligned APK into an unsigned, unaligned APK.  Sadly |zip -q| doesn't
+# silence a warning about "nothing to do" so we pipe to /dev/null.
+RELEASE_SIGN_ANDROID_APK = \
+  cp $(1) $(2)-unaligned.apk && \
+  ($(ZIP) -d $(2)-unaligned.apk 'META-INF/*' > /dev/null || true) && \
+  $(RELEASE_JARSIGNER) $(2)-unaligned.apk && \
+  $(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \
+  $(RM) $(2)-unaligned.apk
 
 # Files packed into the APK root.  Packing files into the APK root is not
 # supported by modern Android build systems, including Gradle, so don't add to
 # this list without Android peer approval.
 ROOT_FILES := \
   application.ini \
   package-name.txt \
   ua-update.json \