Skip to content

Commit

Permalink
Bug 1203800 - Allow for specifying the ANDROID_VERSION_CODE to use; r…
Browse files Browse the repository at this point in the history
…=nalexander

This patch allows you to set MOZ_APP_ANDROID_VERSION_CODE in a branding's configure.sh to specify the exact android:versionCode to use in the final (main) APK.  It does *not* modify the android:versionCode used in any other APKs.

--HG--
extra : transplant_source : U%F31E%1AK%3BY%18e.%E8%BD%F3_0%04%C6%84%7B
  • Loading branch information
toonetown committed Sep 11, 2015
1 parent d46b475 commit bc36c93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -8720,6 +8720,10 @@ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
# "Profile" field, which controls profile location.
# - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
# crash reporter server url.
# - MOZ_APP_ANDROID_VERSION_CODE: On android, "android:versionCode" for
# the main application is set to the value of this variable. If not
# set, it falls back to a Mozilla-specific value derived from the
# build ID.
# - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.

if test -z "$MOZ_APP_NAME"; then
Expand Down Expand Up @@ -8763,6 +8767,7 @@ AC_SUBST(MOZ_APP_BASENAME)
AC_SUBST(MOZ_APP_VENDOR)
AC_SUBST(MOZ_APP_PROFILE)
AC_SUBST(MOZ_APP_ID)
AC_SUBST(MOZ_APP_ANDROID_VERSION_CODE)
AC_SUBST(MAR_CHANNEL_ID)
AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
AC_SUBST(MOZ_PROFILE_MIGRATOR)
Expand Down
20 changes: 13 additions & 7 deletions mobile/android/base/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@

MOZ_APP_BUILDID=$(shell cat $(DEPTH)/config/buildid)

ANDROID_VERSION_CODE:=$(shell $(PYTHON) \
$(topsrcdir)/python/mozbuild/mozbuild/android_version_code.py \
--verbose \
--with-android-cpu-arch=$(ANDROID_CPU_ARCH) \
$(if $(MOZ_ANDROID_MIN_SDK_VERSION),--with-android-min-sdk=$(MOZ_ANDROID_MIN_SDK_VERSION)) \
$(if $(MOZ_ANDROID_MAX_SDK_VERSION),--with-android-max-sdk=$(MOZ_ANDROID_MAX_SDK_VERSION)) \
$(MOZ_APP_BUILDID))
# Set the appropriate version code, based on the existance of the
# MOZ_APP_ANDROID_VERSION_CODE variable.
ifdef MOZ_APP_ANDROID_VERSION_CODE
ANDROID_VERSION_CODE:=$(MOZ_APP_ANDROID_VERSION_CODE)
else
ANDROID_VERSION_CODE:=$(shell $(PYTHON) \
$(topsrcdir)/python/mozbuild/mozbuild/android_version_code.py \
--verbose \
--with-android-cpu-arch=$(ANDROID_CPU_ARCH) \
$(if $(MOZ_ANDROID_MIN_SDK_VERSION),--with-android-min-sdk=$(MOZ_ANDROID_MIN_SDK_VERSION)) \
$(if $(MOZ_ANDROID_MAX_SDK_VERSION),--with-android-max-sdk=$(MOZ_ANDROID_MAX_SDK_VERSION)) \
$(MOZ_APP_BUILDID))
endif

DEFINES += \
-DANDROID_VERSION_CODE=$(ANDROID_VERSION_CODE) \
Expand Down

0 comments on commit bc36c93

Please sign in to comment.