mobile/android/config/mozconfigs/common
author Makoto Kato <m_kato@ga2.so-net.ne.jp>
Sun, 29 Oct 2017 22:56:41 +0900
changeset 388924 c1c3b82079a559138c75facbdce0c14351e90ebc
parent 386197 4f50c65e62c3e3a1121d2314a094ac9b59d35ab2
child 389608 d42cde31f72fbb0b36f1de7b0225902fdc3ad17d
permissions -rw-r--r--
Bug 1411802 - Build stylo on Android as default. r=nalexander,snorp,jryans - Building is nightly channel only. Beta and release for Fennec 58 don't build stylo. It means that the package size for 58 beta/release isn't incremented by this change. - The preference for stylo is still turned off Nightly 58. It will be turned on 59 after fixing some bugs for crashtests and etc. Our target to enable stylo for Android is 59. - ./mach bootstrap already installs clang etc to build stylo and bindgen. Developers for mobile won't require additional build options for this change. MozReview-Commit-ID: CIpYl8I5d7x

# 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 is included at the top of all native android mozconfigs
if [ "x$IS_NIGHTLY" = "xyes" ]; then
  MOZ_AUTOMATION_UPLOAD_SYMBOLS=${MOZ_AUTOMATION_UPLOAD_SYMBOLS-1}
fi

if [ -z "$NO_NDK" ]; then
  . "$topsrcdir/build/mozconfig.stylo"
fi

MOZ_AUTOMATION_L10N_CHECK=0
. "$topsrcdir/build/mozconfig.common"

# For actual Android builds in TaskCluster, the system image is Debian,
# and we use the Java JRE/JDK from the system, as well as the system
# GCC for the host compiler.  l10n builds are still special, however:
# they are run on older CentOS systems, and l10n builds on release are
# still run on Buildbot.  So we have to set things up so this mozconfig
# works in all cases.
if [ -f /etc/debian_version ]; then
    # We're on Debian, there's nothing to do.
    true
elif [ ! -f /etc/redhat-release ] || [ "$(< /etc/redhat-release)" != "CentOS release 6.2 (Final)" ]; then
    # set JAVA_HOME to find the JRE/JDK from tooltool.  Several scripts in the JDK
    # assume `java` is in PATH, so set that too.  To see how this tarball is built,
    # see taskcluster/scripts/builder/build-android-dependencies/repackage-jdk-centos.sh
    export JAVA_HOME="$topsrcdir/java_home"
    export PATH="$PATH:$topsrcdir/java_home/bin"

    mk_add_options "export JAVA_HOME=$topsrcdir/java_home"
    mk_add_options "export PATH=$PATH:$topsrcdir/java_home/bin"

    HOST_CC="$topsrcdir/gcc/bin/gcc"
    HOST_CXX="$topsrcdir/gcc/bin/g++"
fi

ac_add_options --enable-elf-hack

ANDROID_NDK_VERSION="r10e"
ANDROID_NDK_VERSION_32BIT="r8c"

# Build Fennec
ac_add_options --enable-application=mobile/android
ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux"

if [ -z "$NO_NDK" ]; then
    ac_add_options --with-android-ndk="$topsrcdir/android-ndk"
fi

ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}

ac_add_options --with-google-api-keyfile=/builds/gapi.data
ac_add_options --with-mozilla-api-keyfile=/builds/mozilla-fennec-geoloc-api.key

# MOZ_INSTALL_TRACKING does not guarantee MOZ_UPDATE_CHANNEL will be set so we
# provide a default state. Currently, the default state provides a default
# keyfile because an assertion will be thrown if MOZ_INSTALL_TRACKING is
# specified but a keyfile is not. This assertion can catch if we misconfigure a
# release or beta build and it does not have a valid keyfile.
#
# However, by providing a default keyfile, if we misconfigure beta or release,
# the default keyfile may be used instead and the assertion won't catch the
# error.  Therefore, it would be ideal to have MOZ_INSTALL_TRACKING guarantee
# MOZ_UPDATE_CHANNEL was set so we can remove the default case. This may occur
# when release promotion is implemented on Android.
#
# In all cases, we don't upload Adjust pings in automation.
if test "$MOZ_UPDATE_CHANNEL" = "release" ; then
    ac_add_options --with-adjust-sdk-keyfile=/builds/adjust-sdk.token
elif test "$MOZ_UPDATE_CHANNEL" = "beta" ; then
    ac_add_options --with-adjust-sdk-keyfile=/builds/adjust-sdk-beta.token
else
    ac_add_options --with-adjust-sdk-keyfile="$topsrcdir/mobile/android/base/adjust-sdk-sandbox.token"
fi

# MOZ_ANDROID_MMA depends on --with-leanplum-sdk-keyfile, and there's no default
# keyfile set, so if we misconfigure beta or release, the builds will fail (at
# configure time).
if test "$MOZ_UPDATE_CHANNEL" = "release" ; then
    ac_add_options --with-leanplum-sdk-keyfile=/builds/leanplum-sdk-release.token
elif test "$MOZ_UPDATE_CHANNEL" = "beta" ; then
    ac_add_options --with-leanplum-sdk-keyfile=/builds/leanplum-sdk-beta.token
elif test "$MOZ_UPDATE_CHANNEL" = "nightly" ; then
    ac_add_options --with-leanplum-sdk-keyfile=/builds/leanplum-sdk-nightly.token
else
    ac_add_options --with-leanplum-sdk-keyfile="$topsrcdir/mobile/android/base/leanplum-sdk-sandbox.token"
fi

# MOZ_ANDROID_POCKET depends on --with-pocket-api-keyfile, and will
# fail if MOZ_ANDROID_POCKET is specified but a keyfile is not. There's no default
# keyfile set, so if we misconfigure beta or release or nightly, the builds will
# fail (at configure time).
# Otherwise, Pocket is not a critical component so it can be built with a dummy key.
if test "$MOZ_UPDATE_CHANNEL" = "release" ; then
    ac_add_options --with-pocket-api-keyfile=/builds/pocket-api-release.token
elif test "$MOZ_UPDATE_CHANNEL" = "beta" ; then
    ac_add_options --with-pocket-api-keyfile=/builds/pocket-api-beta.token
elif test "$MOZ_UPDATE_CHANNEL" = "nightly" ; then
    ac_add_options --with-pocket-api-keyfile=/builds/pocket-api-nightly.token
else
    ac_add_options --with-pocket-api-keyfile="$topsrcdir/mobile/android/base/pocket-api-sandbox.token"
fi

export SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE=/builds/crash-stats-api.token

# Package js shell.
export MOZ_PACKAGE_JSSHELL=1

. "$topsrcdir/build/unix/mozconfig.stdcxx"

JS_BINARY="$topsrcdir/mobile/android/config/js_wrapper.sh"

export PROGUARD_JAR="$topsrcdir/proguard/lib/proguard.jar"