Bug 1317089 - Pre: Pass --debug-mode to aapt. r=sebastian,gps
Gradle always sets android:debuggable from build.gradle switches (and
warns about having it in AndroidManifest.xml). Future patches in this
series unify how we produce the Android manifest, and this makes it
easier to compare the resulting productions.
MozReview-Commit-ID: 47g4AZX8Z6a
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -23,25 +23,17 @@
#include FennecManifest_permissions.xml.in
<application android:label="@string/moz_app_displayname"
android:icon="@drawable/icon"
android:logo="@drawable/logo"
android:name="@MOZ_ANDROID_APPLICATION_CLASS@"
android:hardwareAccelerated="true"
android:supportsRtl="true"
- android:allowBackup="false"
-# The preprocessor does not yet support arbitrary parentheses, so this cannot
-# be parenthesized thus to clarify that the logical AND operator has precedence:
-# !defined(MOZILLA_OFFICIAL) || (defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG))
-#if !defined(MOZILLA_OFFICIAL) || defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG)
- android:debuggable="true">
-#else
- android:debuggable="false">
-#endif
+ android:allowBackup="false">
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
#ifdef MOZ_NATIVE_DEVICES
<!-- This resources comes from Google Play Services. Required for casting support. -->
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<service android:name="org.mozilla.gecko.RemotePresentationService" android:exported="false"/>
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -440,30 +440,43 @@ ANDROID_AAPT_IGNORE := !.svn:!.git:.*:<d
# 3: name of ap_ file to write.
# 4: directory to write R.java into.
# 5: directory to write R.txt into.
# We touch the target file before invoking aapt so that aapt's outputs
# are fresher than the target, preventing a subsequent invocation from
# thinking aapt's outputs are stale. This is safe because Make
# removes the target file if any recipe command fails.
+# The --debug-mode flag below is intended to be:
+# !defined(MOZILLA_OFFICIAL) || (defined(NIGHTLY_BUILD) && defined(MOZ_DEBUG))
+ifdef MOZILLA_OFFICIAL
+ifdef NIGHTLY_BUILD
+ifdef MOZ_DEBUG
+debug := 1
+endif
+endif
+else
+debug := 1
+endif
+
define aapt_command
$(1): $$(call mkdir_deps,$(filter-out ./,$(dir $(3) $(4) $(5)))) $(2)
@$$(TOUCH) $$@
$$(AAPT) package -f -m \
-M AndroidManifest.xml \
-I $(ANDROID_SDK)/android.jar \
$(if $(MOZ_ANDROID_MAX_SDK_VERSION),--max-res-version $(MOZ_ANDROID_MAX_SDK_VERSION),) \
--auto-add-overlay \
$$(addprefix -S ,$$(ANDROID_RES_DIRS)) \
$$(addprefix -A ,$$(ANDROID_ASSETS_DIRS)) \
$(if $(ANDROID_EXTRA_PACKAGES),--extra-packages $$(subst $$(NULL) ,:,$$(strip $$(ANDROID_EXTRA_PACKAGES)))) \
$(if $(ANDROID_EXTRA_RES_DIRS),$$(addprefix -S ,$$(ANDROID_EXTRA_RES_DIRS))) \
--custom-package org.mozilla.gecko \
--no-version-vectors \
+ $(if $(debug),--debug-mode) \
-F $(3) \
-J $(4) \
--output-text-symbols $(5) \
--ignore-assets "$$(ANDROID_AAPT_IGNORE)"
endef
# [Comment 3/3] The first of these rules is used during regular
# builds. The second writes an ap_ file that is only used during