2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2016-03-08 07:49:35 +03:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# 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/.
|
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_ANDROID_EXCLUDE_FONTS',
|
|
|
|
help='Whether to exclude font files from the build',
|
|
|
|
default=True)
|
2016-04-22 23:01:21 +03:00
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_ANDROID_GCM',
|
2017-05-16 00:37:54 +03:00
|
|
|
help='Enable GCM (Google Cloud Messaging) registration',
|
2016-06-02 20:54:17 +03:00
|
|
|
default=True,
|
2016-05-12 21:55:58 +03:00
|
|
|
set_for_old_configure=True)
|
2016-04-22 23:01:21 +03:00
|
|
|
|
2017-05-16 00:37:54 +03:00
|
|
|
option(env='MOZ_NATIVE_DEVICES',
|
|
|
|
help='Enable second screen support using native Android libraries.',
|
|
|
|
default=True)
|
|
|
|
|
|
|
|
set_config('MOZ_NATIVE_DEVICES',
|
|
|
|
depends_if('MOZ_NATIVE_DEVICES')(lambda _: True))
|
|
|
|
add_old_configure_assignment('MOZ_NATIVE_DEVICES',
|
|
|
|
depends_if('MOZ_NATIVE_DEVICES')(lambda _: True))
|
|
|
|
|
|
|
|
# Enable install tracking SDK if we have Google Play support; MOZ_NATIVE_DEVICES
|
|
|
|
# is a proxy flag for that support.
|
|
|
|
@depends(milestone, 'MOZ_NATIVE_DEVICES', '--help')
|
|
|
|
def install_tracking_default(milestone, native_devices, help):
|
|
|
|
return bool(milestone.is_release_or_beta and native_devices)
|
|
|
|
|
|
|
|
option(env='MOZ_INSTALL_TRACKING',
|
|
|
|
help='Enable install tracking (currently using the Adjust SDK).',
|
|
|
|
default=install_tracking_default)
|
|
|
|
|
|
|
|
set_config('MOZ_INSTALL_TRACKING',
|
|
|
|
depends_if('MOZ_INSTALL_TRACKING')(lambda _: True))
|
|
|
|
add_old_configure_assignment('MOZ_INSTALL_TRACKING',
|
|
|
|
depends_if('MOZ_INSTALL_TRACKING')(lambda _: True))
|
|
|
|
|
2017-05-26 22:31:20 +03:00
|
|
|
option(env='MOZ_ANDROID_MMA',
|
|
|
|
help='Enable mobile marketing automation (currently using the Leanplum SDK).',
|
|
|
|
default=False)
|
|
|
|
|
|
|
|
set_config('MOZ_ANDROID_MMA',
|
|
|
|
depends_if('MOZ_ANDROID_MMA')(lambda _: True))
|
|
|
|
|
2017-08-09 22:11:10 +03:00
|
|
|
option(env='MOZ_ANDROID_POCKET',
|
|
|
|
help='Enable Pocket Stories in Activity Stream.',
|
2017-08-11 01:36:58 +03:00
|
|
|
default=False)
|
2017-08-09 22:11:10 +03:00
|
|
|
|
|
|
|
set_config('MOZ_ANDROID_POCKET',
|
|
|
|
depends_if('MOZ_ANDROID_POCKET')(lambda _: True))
|
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_ANDROID_DOWNLOADS_INTEGRATION',
|
|
|
|
help='Enable system download manager on Android',
|
|
|
|
default=True)
|
2016-04-22 23:01:21 +03:00
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_ANDROID_BEAM',
|
|
|
|
help='Enable NFC permission on Android',
|
|
|
|
default=True)
|
2016-04-22 23:01:21 +03:00
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_ANDROID_SEARCH_ACTIVITY',
|
|
|
|
help='Include Search Activity on Android',
|
|
|
|
default=True)
|
2016-04-22 23:01:22 +03:00
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_ANDROID_MLS_STUMBLER',
|
|
|
|
help='Include Mozilla Location Service Stumbler on Android',
|
|
|
|
default=True)
|
2016-04-22 23:01:22 +03:00
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_ANDROID_DOWNLOAD_CONTENT_SERVICE',
|
|
|
|
help='Background service for downloading additional content at runtime',
|
|
|
|
default=True)
|
2016-04-22 23:01:22 +03:00
|
|
|
|
2017-06-12 09:58:10 +03:00
|
|
|
project_flag('MOZ_ANDROID_CUSTOM_TABS',
|
|
|
|
help='Enable support for Android custom tabs',
|
|
|
|
default=milestone.is_nightly)
|
|
|
|
|
2017-06-28 11:18:54 +03:00
|
|
|
project_flag('MOZ_ANDROID_PWA',
|
|
|
|
help='Enable support for Progressive Web Apps',
|
|
|
|
default=milestone.is_nightly)
|
|
|
|
|
2016-04-22 23:01:22 +03:00
|
|
|
# Enable the Switchboard A/B framework code.
|
|
|
|
# Note: The framework is always included in the app. This flag controls
|
|
|
|
# usage of the framework.
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_SWITCHBOARD',
|
|
|
|
help='Include Switchboard A/B framework on Android',
|
|
|
|
default=True)
|
2016-04-22 23:01:22 +03:00
|
|
|
|
2017-05-23 21:51:32 +03:00
|
|
|
project_flag('MOZ_ANDROID_HLS_SUPPORT',
|
|
|
|
help='Enable HLS (HTTP Live Streaming) support (currently using the ExoPlayer library)',
|
2017-08-01 12:44:58 +03:00
|
|
|
default=True)
|
2017-05-23 21:51:32 +03:00
|
|
|
|
2017-03-24 00:45:57 +03:00
|
|
|
option(env='MOZ_ANDROID_ACTIVITY_STREAM',
|
|
|
|
help='Enable Activity Stream on Android (replacing the default HomePager)',
|
|
|
|
default=False)
|
|
|
|
|
|
|
|
set_config('MOZ_ANDROID_ACTIVITY_STREAM',
|
|
|
|
depends_if('MOZ_ANDROID_ACTIVITY_STREAM')(lambda _: True))
|
|
|
|
|
2017-06-05 22:42:53 +03:00
|
|
|
option(env='MOZ_ANDROID_MOZILLA_ONLINE',
|
|
|
|
help='Enable MozillaOnline (Mozilla China) specific Android code',
|
|
|
|
default=False)
|
|
|
|
|
|
|
|
set_config('MOZ_ANDROID_MOZILLA_ONLINE',
|
|
|
|
depends_if('MOZ_ANDROID_MOZILLA_ONLINE')(lambda _: True))
|
|
|
|
|
2016-06-09 21:37:40 +03:00
|
|
|
option(env='MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER',
|
|
|
|
help='Build and package the install bouncer APK',
|
|
|
|
default=True)
|
|
|
|
|
|
|
|
set_config('MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER',
|
|
|
|
depends_if('MOZ_ANDROID_PACKAGE_INSTALL_BOUNCER')(lambda _: True))
|
|
|
|
|
2016-05-12 21:55:59 +03:00
|
|
|
imply_option('MOZ_SOCIAL', False)
|
2016-05-12 21:55:59 +03:00
|
|
|
imply_option('MOZ_SERVICES_HEALTHREPORT', True)
|
2016-05-18 00:40:03 +03:00
|
|
|
imply_option('MOZ_ANDROID_HISTORY', True)
|
2016-05-12 21:55:59 +03:00
|
|
|
|
2016-09-30 19:16:23 +03:00
|
|
|
set_config('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0')
|
|
|
|
add_old_configure_assignment('ANDROID_SUPPORT_LIBRARY_VERSION', '23.4.0')
|
2016-05-31 20:14:35 +03:00
|
|
|
|
|
|
|
set_config('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
|
|
|
|
add_old_configure_assignment('ANDROID_GOOGLE_PLAY_SERVICES_VERSION', '8.4.0')
|
|
|
|
|
2016-04-02 04:39:54 +03:00
|
|
|
@depends(target)
|
|
|
|
def check_target(target):
|
|
|
|
if target.os != 'Android':
|
|
|
|
log.error('You must specify --target=arm-linux-androideabi (or some '
|
|
|
|
'other valid Android target) when building mobile/android.')
|
|
|
|
die('See https://developer.mozilla.org/docs/Mozilla/Developer_guide/'
|
|
|
|
'Build_Instructions/Simple_Firefox_for_Android_build '
|
|
|
|
'for more information about the necessary options.')
|
|
|
|
|
2016-03-08 07:49:35 +03:00
|
|
|
include('../../toolkit/moz.configure')
|
2016-05-12 21:55:57 +03:00
|
|
|
include('../../build/moz.configure/java.configure')
|
2016-03-17 21:04:08 +03:00
|
|
|
include('gradle.configure')
|
2017-05-16 00:37:54 +03:00
|
|
|
|
|
|
|
# Must come after the ../../toolkit/moz.configure.
|
|
|
|
@depends('MOZ_INSTALL_TRACKING', 'MOZ_NATIVE_DEVICES', '--with-adjust-sdk-keyfile')
|
|
|
|
def check_install_tracking(install_tracking,
|
|
|
|
native_devices,
|
|
|
|
adjust_sdk_keyfile):
|
|
|
|
if install_tracking:
|
|
|
|
if not native_devices:
|
|
|
|
die('You must specify MOZ_NATIVE_DEVICES=1 when'
|
|
|
|
' building with MOZ_INSTALL_TRACKING=1')
|
|
|
|
if not adjust_sdk_keyfile:
|
|
|
|
die('You must specify --with-adjust-sdk-keyfile=/path/to/keyfile when'
|
|
|
|
' building with MOZ_INSTALL_TRACKING=1')
|
2017-05-26 22:31:20 +03:00
|
|
|
|
|
|
|
# Must come after the ../../toolkit/moz.configure.
|
|
|
|
@depends('MOZ_ANDROID_MMA',
|
|
|
|
'MOZ_NATIVE_DEVICES',
|
|
|
|
'MOZ_ANDROID_GCM',
|
|
|
|
'--with-leanplum-sdk-keyfile')
|
|
|
|
def check_android_mma(android_mma,
|
|
|
|
native_devices,
|
|
|
|
android_gcm,
|
|
|
|
leanplum_sdk_keyfile):
|
|
|
|
if android_mma:
|
|
|
|
if not native_devices:
|
|
|
|
die('You must specify MOZ_NATIVE_DEVICES=1 when'
|
|
|
|
' building with MOZ_ANDROID_MMA=1')
|
|
|
|
if not android_gcm:
|
|
|
|
die('You must specify MOZ_ANDROID_GCM=1 when'
|
|
|
|
' building with MOZ_ANDROID_MMA=1')
|
|
|
|
if not leanplum_sdk_keyfile:
|
|
|
|
die('You must specify --with-leanplum-sdk-keyfile=/path/to/keyfile when'
|
|
|
|
' building with MOZ_ANDROID_MMA=1')
|
2017-08-09 22:11:10 +03:00
|
|
|
|
|
|
|
@depends('MOZ_ANDROID_POCKET',
|
|
|
|
'--with-pocket-api-keyfile')
|
|
|
|
def check_android_pocket(android_pocket, pocket_api_keyfile):
|
|
|
|
if android_pocket and not pocket_api_keyfile:
|
|
|
|
die('You must specify --with-pocket-api-keyfile=/path/to/keyfile when'
|
|
|
|
' building with MOZ_ANDROID_POCKET=1')
|