(bug 1411688) Make --with-gradle handle single-locale repack r=snorp a=reland

--HG--
extra : amend_source : d435c08a762988804bfe23251b8b5f76702eca99
This commit is contained in:
Csoregi Natalia 2017-11-06 15:23:47 +02:00
parent a731ff981c
commit c79466f107
12 changed files with 121 additions and 94 deletions

View File

@ -67,6 +67,10 @@ if ('multi' == System.env.AB_CD) {
// dependency chain to fail, since multi isn't a real locale. To avoid
// this, if Gradle is invoked with AB_CD=multi, we don't invoke Make at all.
task generateCodeAndResources()
} else if (System.env.IS_LANGUAGE_REPACK == '1') {
// Single-locale l10n repacks set `IS_LANGUAGE_REPACK=1` and handle resource
// and code generation themselves.
task generateCodeAndResources()
} else {
task generateCodeAndResources(type:Exec) {
workingDir "${topobjdir}"

View File

@ -2,39 +2,21 @@ NO_NDK=1
. "$topsrcdir/mobile/android/config/mozconfigs/common"
. "$topsrcdir/mobile/android/config/mozconfigs/android-aarch64/nightly"
# L10n
ac_add_options --with-l10n-base=../../l10n-central
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
# Bug 1283438
mk_add_options AUTOCLOBBER=
. "$topsrcdir/build/mozconfig.no-compile"
# Global options
ac_add_options --disable-tests
# Android
ac_add_options --with-android-min-sdk=21
ac_add_options --target=aarch64-linux-android
ac_add_options --enable-updater
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
export MOZILLA_OFFICIAL=1
ac_add_options --with-branding=mobile/android/branding/nightly
ac_add_options --disable-stdcxx-compat
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
# Bug 1283438
mk_add_options AUTOCLOBBER=
# Disable Keyfile Loading (and checks) since l10n doesn't need these keys
# This overrides the settings in the common android mozconfig
ac_add_options --without-mozilla-api-keyfile
ac_add_options --without-google-api-keyfile
ac_add_options --without-adjust-sdk-keyfile
ac_add_options --without-leanplum-sdk-keyfile
ac_add_options --without-pocket-api-keyfile
# Similarly explicitly disable install tracking for l10n, we'll inherit from en-US
export MOZ_INSTALL_TRACKING=
. "$topsrcdir/mobile/android/config/mozconfigs/common.override"

View File

@ -2,44 +2,21 @@ NO_NDK=1
. "$topsrcdir/mobile/android/config/mozconfigs/common"
. "$topsrcdir/mobile/android/config/mozconfigs/android-api-16/nightly"
# L10n
ac_add_options --with-l10n-base=../../l10n-central
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
# Bug 1283438
mk_add_options AUTOCLOBBER=
. "$topsrcdir/build/mozconfig.no-compile"
# Global options
ac_add_options --disable-tests
# Android
# Warning: Before increasing the with-android-min-sdk value, please note several places in and out
# of tree have to be changed. Otherwise, places like Treeherder or archive.mozilla.org will
# advertise a bad API level. This may confuse people. As an example, please look at bug 1384482.
# If you think you can't handle the whole set of changes, please reach out to the Release
# Engineering team.
ac_add_options --with-android-min-sdk=16
ac_add_options --target=arm-linux-androideabi
ac_add_options --enable-updater
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
export MOZILLA_OFFICIAL=1
ac_add_options --with-branding=mobile/android/branding/nightly
ac_add_options --disable-stdcxx-compat
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
# Bug 1283438
mk_add_options AUTOCLOBBER=
# Disable Keyfile Loading (and checks) since l10n doesn't need these keys
# This overrides the settings in the common android mozconfig
ac_add_options --without-mozilla-api-keyfile
ac_add_options --without-google-api-keyfile
ac_add_options --without-adjust-sdk-keyfile
ac_add_options --without-leanplum-sdk-keyfile
ac_add_options --without-pocket-api-keyfile
# Similarly explicitly disable install tracking for l10n, we'll inherit from en-US
export MOZ_INSTALL_TRACKING=
. "$topsrcdir/mobile/android/config/mozconfigs/common.override"

View File

@ -2,34 +2,21 @@ NO_NDK=1
. "$topsrcdir/mobile/android/config/mozconfigs/common"
. "$topsrcdir/mobile/android/config/mozconfigs/android-x86/nightly"
# L10n
ac_add_options --with-l10n-base=../../l10n-central
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
# Bug 1283438
mk_add_options AUTOCLOBBER=
. "$topsrcdir/build/mozconfig.no-compile"
# Global options
ac_add_options --disable-tests
# Android
# Warning: Before increasing the with-android-min-sdk value, please note several places in and out
# of tree have to be changed. Otherwise, places like Treeherder or archive.mozilla.org will
# advertise a bad API level. This may confuse people. As an example, please look at bug 1384482.
# If you think you can't handle the whole set of changes, please reach out to the Release
# Engineering team.
ac_add_options --target=i386-linux-android
ac_add_options --with-android-min-sdk=16
ac_add_options --enable-updater
ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
export MOZILLA_OFFICIAL=1
ac_add_options --with-branding=mobile/android/branding/nightly
ac_add_options --disable-stdcxx-compat
# Don't autoclobber l10n, as this can lead to missing binaries and broken builds
# Bug 1283438
mk_add_options AUTOCLOBBER=
. "$topsrcdir/mobile/android/config/mozconfigs/common.override"

View File

@ -55,7 +55,8 @@ android {
// TODO: ensure these fields always agree with mobile/android/geckoview/BuildConfig.java.in,
// either by diffing the processed files or by generating the output from a single source.
buildConfigField 'String', "GRE_MILESTONE", "\"${mozconfig.substs.GRE_MILESTONE}\""
buildConfigField 'String', "MOZ_APP_ABI", "\"${mozconfig.substs.TARGET_XPCOM_ABI}\"";
// This should really come from the included binaries, but that's not easy.
buildConfigField 'String', "MOZ_APP_ABI", mozconfig.substs['COMPILE_ENVIRONMENT'] ? "\"${ mozconfig.substs.TARGET_XPCOM_ABI}\"" : '"arm-eabi-gcc3"';
buildConfigField 'String', "MOZ_APP_BASENAME", "\"${mozconfig.substs.MOZ_APP_BASENAME}\"";
// For the benefit of future archaeologists:

View File

@ -152,25 +152,32 @@ ext.configureVariantWithJNIWrappers = { variant, module ->
// suggest that it is. It certainly doesn't hurt.
def prepareDependenciesTask = tasks.getByName("prepare${variant.name.capitalize()}Dependencies")
def wrapperTask = task("generateJNIWrappersFor${module}${variant.name.capitalize()}", type: JavaExec) {
classpath "${topobjdir}/build/annotationProcessors/annotationProcessors.jar"
// Configure the classpath at evaluation-time, not at
// configuration-time: see above comment.
doFirst {
classpath variant.javaCompile.classpath
// Include android.jar.
classpath variant.javaCompile.options.bootClasspath
def wrapperTask
if (System.env.IS_LANGUAGE_REPACK == '1') {
// Single-locale l10n repacks set `IS_LANGUAGE_REPACK=1` and don't
// really have a build environment.
wrapperTask = task("generateJNIWrappersFor${module}${variant.name.capitalize()}")
} else {
wrapperTask = task("generateJNIWrappersFor${module}${variant.name.capitalize()}", type: JavaExec) {
classpath "${topobjdir}/build/annotationProcessors/annotationProcessors.jar"
// Configure the classpath at evaluation-time, not at
// configuration-time: see above comment.
doFirst {
classpath variant.javaCompile.classpath
// Include android.jar.
classpath variant.javaCompile.options.bootClasspath
}
main = 'org.mozilla.gecko.annotationProcessors.AnnotationProcessor'
args module
args jarTask.outputs.files.iterator().next()
workingDir "${topobjdir}/mobile/android/base"
dependsOn jarTask
dependsOn prepareDependenciesTask
}
main = 'org.mozilla.gecko.annotationProcessors.AnnotationProcessor'
args module
args jarTask.outputs.files.iterator().next()
workingDir "${topobjdir}/mobile/android/base"
dependsOn jarTask
dependsOn prepareDependenciesTask
}
if (module == 'Generated') {

View File

@ -46,6 +46,10 @@ job-template:
android-api-16-l10n:
in-tree: android-build
win.*: null
secrets:
by-build-platform:
default: false
android-api-16-l10n: true
toolchains:
by-build-platform:
default: []
@ -110,7 +114,8 @@ job-template:
actions:
by-build-platform:
default: [clone-locales list-locales setup repack summary]
android-api-16-l10n: [clone-locales list-locales setup repack
android-api-16-l10n: [get-secrets
clone-locales list-locales setup repack
upload-repacks summary]
script:
by-build-platform:

View File

@ -49,6 +49,10 @@ job-template:
android-api-16-nightly:
in-tree: android-build
win.*: null
secrets:
by-build-platform:
default: false
android-api-16-nightly: true
toolchains:
by-build-platform:
default: []
@ -171,7 +175,8 @@ job-template:
by-build-platform:
default: ['clone-locales', 'list-locales', 'setup', 'repack',
'submit-to-balrog', 'summary']
android-api-16-nightly: ['clone-locales', 'list-locales', 'setup', 'repack',
android-api-16-nightly: ['get-secrets',
'clone-locales', 'list-locales', 'setup', 'repack',
'upload-repacks', 'submit-to-balrog', 'summary']
script:
by-build-platform:

View File

@ -107,6 +107,13 @@ l10n_description_schema = Schema({
Optional('toolchains'): _by_platform([basestring]),
# The set of secret names to which the task has access; these are prefixed
# with `project/releng/gecko/{treeherder.kind}/level-{level}/`. Setting
# this will enable any worker features required and set the task's scopes
# appropriately. `true` here means ['*'], all secrets. Not supported on
# Windows
Required('secrets', default=False): _by_platform(Any(bool, [basestring])),
# Information for treeherder
Required('treeherder'): {
# Platform to display the task on in treeherder
@ -251,6 +258,7 @@ def handle_keyed_by(config, jobs):
"description",
"run-time",
"docker-image",
"secrets",
"toolchains",
"tooltool",
"env",
@ -385,6 +393,7 @@ def make_job_description(config, jobs):
'script': job['mozharness']['script'],
'actions': job['mozharness']['actions'],
'options': job['mozharness']['options'],
'secrets': job['secrets'],
},
'attributes': job['attributes'],
'treeherder': {

View File

@ -15,4 +15,37 @@ config = {
},
"mozilla_dir": "src/",
"simple_name_move": True,
'secret_files': [
{'filename': '/builds/gapi.data',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/gapi.data',
'min_scm_level': 1},
{'filename': '/builds/mozilla-fennec-geoloc-api.key',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/mozilla-fennec-geoloc-api.key',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/adjust-sdk.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/adjust-sdk.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/adjust-sdk-beta.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/adjust-sdk-beta.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/leanplum-sdk-release.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/leanplum-sdk-release.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/leanplum-sdk-beta.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/leanplum-sdk-beta.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/leanplum-sdk-nightly.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/leanplum-sdk-nightly.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/pocket-api-release.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/pocket-api-release.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/pocket-api-beta.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/pocket-api-beta.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
{'filename': '/builds/pocket-api-nightly.token',
'secret_name': 'project/releng/gecko/build/level-%(scm-level)s/pocket-api-nightly.token',
'min_scm_level': 2, 'default': 'try-build-has-no-secrets'},
],
}

View File

@ -38,6 +38,7 @@ from mozharness.mozilla.tooltool import TooltoolMixin
from mozharness.base.vcs.vcsbase import MercurialScript
from mozharness.mozilla.l10n.locales import LocalesMixin
from mozharness.mozilla.mock import MockMixin
from mozharness.mozilla.secrets import SecretsMixin
from mozharness.mozilla.updates.balrog import BalrogMixin
from mozharness.base.python import VirtualenvMixin
from mozharness.mozilla.taskcluster_helper import Taskcluster
@ -47,7 +48,7 @@ from mozharness.mozilla.taskcluster_helper import Taskcluster
class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin,
MobileSigningMixin, TransferMixin, TooltoolMixin,
BuildbotMixin, PurgeMixin, MercurialScript, BalrogMixin,
VirtualenvMixin):
VirtualenvMixin, SecretsMixin):
config_options = [[
['--locale', ],
{"action": "extend",
@ -124,6 +125,7 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin,
def __init__(self, require_config_file=True):
buildscript_kwargs = {
'all_actions': [
"get-secrets",
"clobber",
"pull",
"clone-locales",
@ -185,6 +187,20 @@ class MobileSingleLocale(MockMixin, LocalesMixin, ReleaseMixin,
if 'MOZ_SIGNING_SERVERS' in os.environ:
repack_env['MOZ_SIGN_CMD'] = \
subprocess.list2cmdline(self.query_moz_sign_cmd(formats=['jar']))
if self.query_is_nightly() or self.query_is_nightly_promotion():
if self.query_is_nightly():
# Nightly promotion needs to set update_channel but not do all
# the 'IS_NIGHTLY' automation parts, like uploading symbols
# (for now).
repack_env["IS_NIGHTLY"] = "yes"
# In branch_specifics.py we might set update_channel explicitly.
if c.get('update_channel'):
repack_env["MOZ_UPDATE_CHANNEL"] = c['update_channel']
else: # Let's just give the generic channel based on branch.
repack_env["MOZ_UPDATE_CHANNEL"] = \
"nightly-%s" % (c['branch'],)
self.repack_env = repack_env
return self.repack_env

View File

@ -94,6 +94,7 @@ repackage_fennec = \
$(UNPACKAGE) \
$(GECKO_APP_AP_PATH)/gecko-nodeps.ap_ \
--omnijar $(MOZ_PKG_DIR)/$(OMNIJAR_NAME) \
--classes-dex $(GECKO_APP_AP_PATH)/classes.dex \
--output $(PACKAGE:.apk=-unsigned-unaligned.apk) && \
$(call RELEASE_SIGN_ANDROID_APK,$(PACKAGE:.apk=-unsigned-unaligned.apk),$(PACKAGE))