Bug 1473362 [wpt PR 11778] - Update wpt metadata, a=testonly
[gecko.git] / config / android-common.mk
bloba54f20b88e109178325b9548b6a0db8064682203
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 # Ensure ANDROID_SDK is defined before including this file.
6 # We use common android defaults for boot class path and java version.
7 ifndef ANDROID_SDK
8 $(error ANDROID_SDK must be defined before including android-common.mk)
9 endif
11 # DEBUG_JARSIGNER always debug signs.
12 DEBUG_JARSIGNER=$(PYTHON) $(abspath $(topsrcdir)/mobile/android/debug_sign_tool.py) \
13 --keytool=$(KEYTOOL) \
14 --jarsigner=$(JARSIGNER) \
15 $(NULL)
17 # RELEASE_JARSIGNER release signs if possible.
18 ifdef MOZ_SIGN_CMD
19 RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar
20 else
21 RELEASE_JARSIGNER := $(DEBUG_JARSIGNER)
22 endif
24 # $(1) is the full path to input: foo-debug-unsigned-unaligned.apk.
25 # $(2) is the full path to output: foo.apk.
26 # Use this like: $(call RELEASE_SIGN_ANDROID_APK,foo-debug-unsigned-unaligned.apk,foo.apk)
28 # The |zip -d| there to handle re-signing previously signed APKs. Gradle
29 # produces signed, unaligned APK files, but this expects unsigned, unaligned
30 # APK files. The |zip -d| discards any existing signature, turning a signed,
31 # unaligned APK into an unsigned, unaligned APK. Sadly |zip -q| doesn't
32 # silence a warning about "nothing to do" so we pipe to /dev/null.
33 RELEASE_SIGN_ANDROID_APK = \
34 cp $(1) $(2)-unaligned.apk && \
35 ($(ZIP) -d $(2)-unaligned.apk 'META-INF/*' > /dev/null || true) && \
36 $(RELEASE_JARSIGNER) $(2)-unaligned.apk && \
37 $(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \
38 $(RM) $(2)-unaligned.apk
40 # For Android, we default to 1.7
41 ifndef JAVA_VERSION
42 JAVA_VERSION = 1.7
43 endif
45 JAVAC_FLAGS = \
46 -target $(JAVA_VERSION) \
47 -source $(JAVA_VERSION) \
48 -encoding UTF8 \
49 -g:source,lines \
50 -Werror \
51 $(NULL)