From 61ddcc0a518089112fe265dc81238e5294002839 Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Wed, 27 Jan 2016 12:25:04 -0800 Subject: [PATCH] Bug 1163082 - Part 1: Add --with-android-distribution-directory. r=gps This simply packs the assets/ subdirectory of the distribution directory into the assets/ directory of the Android APK using existing mechanisms. It also removes the older method of manually pushing files into dist/bin/distribution, from where they would be packaged into the APK under distribution/. --- configure.in | 16 ++++++++++++++++ mobile/android/app/build.gradle | 5 +++++ mobile/android/base/moz.build | 5 +++++ mobile/android/installer/package-manifest.in | 1 - toolkit/mozapps/installer/upload-files.mk | 1 - 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 7c1c999be69..03115d4b1ab 100644 --- a/configure.in +++ b/configure.in @@ -4008,6 +4008,22 @@ if test -n "$MOZ_ANDROID_RESOURCE_CONSTRAINED"; then fi AC_SUBST(MOZ_ANDROID_RESOURCE_CONSTRAINED) +# Optional Firefox for Android partner distribution directory. +MOZ_ARG_WITH_STRING(android-distribution-directory, +[ --with-android-distribution-directory=dir + Optional Firefox for Android partner distribution directory.], + MOZ_ANDROID_DISTRIBUTION_DIRECTORY=$withval) + +if test -n "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY"; then + # A distribution directory must have an assets/distribution directory. + # See https://wiki.mozilla.org/Mobile/Distribution_Files. + if test ! -d "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY/assets/distribution" ; then + AC_MSG_ERROR([--with-android-distribution-directory does not contain assets/distribution; + (looked for ${MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets/distribution).]) + fi +fi +AC_SUBST(MOZ_ANDROID_DISTRIBUTION_DIRECTORY) + dnl ======================================================== dnl = Trademarked Branding dnl ======================================================== diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index 789e77cd118..07be3aa9c86 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -65,6 +65,11 @@ android { sourceSets { main { manifest.srcFile "${topobjdir}/mobile/android/base/AndroidManifest.xml" + assets { + if (mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY) { + srcDir "${mozconfig.substs.MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets" + } + } } androidTest { diff --git a/mobile/android/base/moz.build b/mobile/android/base/moz.build index 26bbaf6a448..fc6bf1ab621 100644 --- a/mobile/android/base/moz.build +++ b/mobile/android/base/moz.build @@ -885,6 +885,11 @@ ANDROID_ASSETS_DIRS += [ '/mobile/android/app/assets', ] +if CONFIG['MOZ_ANDROID_DISTRIBUTION_DIRECTORY']: + ANDROID_ASSETS_DIRS += [ + '%' + CONFIG['MOZ_ANDROID_DISTRIBUTION_DIRECTORY'] + '/assets', + ] + # We do not expose MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN here because that # would leak the value to build logs. Instead we expose the token quietly where # appropriate in Makefile.in. diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 6c10168cc95..e43dbe70bfb 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -78,7 +78,6 @@ [xpcom] @BINPATH@/package-name.txt @BINPATH@/classes.dex -@BINPATH@/distribution/* [browser] ; [Base Browser Files] diff --git a/toolkit/mozapps/installer/upload-files.mk b/toolkit/mozapps/installer/upload-files.mk index adecfe5bbc6..abafb8673a3 100644 --- a/toolkit/mozapps/installer/upload-files.mk +++ b/toolkit/mozapps/installer/upload-files.mk @@ -302,7 +302,6 @@ DIST_FILES += \ chrome.manifest \ update.locale \ removed-files \ - distribution \ $(NULL) NON_DIST_FILES = \