diff --git a/mobile/android/geckoview/build.gradle b/mobile/android/geckoview/build.gradle index 922d601f289e..9eb49b7eb964 100644 --- a/mobile/android/geckoview/build.gradle +++ b/mobile/android/geckoview/build.gradle @@ -22,6 +22,8 @@ def getAppVersionWithoutMilestone() { // We take something like 58.1.2a1 and come out with 5800102 // This gives us 3 digits for the major number, and 2 digits // each for the minor and build number. Beta and Release +// +// This must be synchronized with _compute_gecko_version(...) in /taskcluster/taskgraph/transforms/task.py def computeVersionCode() { String appVersion = getAppVersionWithoutMilestone() diff --git a/taskcluster/ci/build/android.yml b/taskcluster/ci/build/android.yml index 23ec85a0eecf..8a6626a73108 100644 --- a/taskcluster/ci/build/android.yml +++ b/taskcluster/ci/build/android.yml @@ -171,7 +171,7 @@ android-x86-nightly/opt: index: product: mobile job-name: android-x86-opt - type: nightly + type: android-nightly treeherder: platform: android-4-2-x86/opt symbol: N @@ -393,7 +393,7 @@ android-api-16-nightly/opt: index: product: mobile job-name: android-api-16-opt - type: nightly-with-multi-l10n + type: android-nightly-with-multi-l10n treeherder: platform: android-4-0-armv7-api16/opt symbol: N @@ -562,7 +562,7 @@ android-aarch64-nightly/opt: index: product: mobile job-name: android-aarch64-opt - type: nightly + type: android-nightly treeherder: platform: android-5-0-aarch64/opt symbol: N @@ -676,7 +676,7 @@ android-x86_64-nightly/opt: index: product: mobile job-name: android-x86_64-opt - type: nightly + type: android-nightly treeherder: platform: android-5-0-x86_64/opt symbol: N diff --git a/taskcluster/taskgraph/transforms/task.py b/taskcluster/taskgraph/transforms/task.py index 7f6cb5471add..fda325acd8bf 100644 --- a/taskcluster/taskgraph/transforms/task.py +++ b/taskcluster/taskgraph/transforms/task.py @@ -50,6 +50,14 @@ def _run_task_suffix(): return hash_path(RUN_TASK)[0:20] +def _compute_geckoview_version(app_version, moz_build_date): + """Geckoview version string that matches geckoview gradle configuration""" + # Must be synchronized with /mobile/android/geckoview/build.gradle computeVersionCode(...) + version_without_milestone = re.sub(r'a[0-9]', '', app_version, 1) + parts = version_without_milestone.split('.') + return "%s.%s.%s" % (parts[0], parts[1], moz_build_date) + + # A task description is a general description of a TaskCluster task task_description_schema = Schema({ # the label for this task @@ -127,7 +135,8 @@ task_description_schema = Schema({ # Type of gecko v2 index to use 'type': Any('generic', 'nightly', 'l10n', 'nightly-with-multi-l10n', - 'release', 'nightly-l10n', 'shippable', 'shippable-l10n'), + 'release', 'nightly-l10n', 'shippable', 'shippable-l10n', + 'android-nightly', 'android-nightly-with-multi-l10n'), # The rank that the task will receive in the TaskCluster # index. A newly completed task supercedes the currently @@ -280,6 +289,10 @@ V2_L10N_TEMPLATES = [ "index.{trust-domain}.v2.{project}.latest.{product}-l10n.{job-name}.{locale}", ] +# This index is specifically for builds that include geckoview releases, +# so we can hard-code the project to "geckoview" +V2_GECKOVIEW_RELEASE = "index.{trust-domain}.v2.{project}.geckoview-version.{geckoview-version}.{product}.{job-name}" # noqa - too long + # the roots of the treeherder routes TREEHERDER_ROUTE_ROOT = 'tc-treeherder' @@ -1632,6 +1645,42 @@ def add_nightly_l10n_index_routes(config, task, force_locale=None): return task +def add_geckoview_index_routes(config, task): + index = task.get('index') + routes = task.setdefault('routes', []) + geckoview_version = _compute_geckoview_version( + config.params['app_version'], + config.params['moz_build_date'] + ) + + subs = { + 'geckoview-version': geckoview_version, + 'job-name': index['job-name'], + 'product': index['product'], + 'project': config.params['project'], + 'trust-domain': config.graph_config['trust-domain'], + } + routes.append(V2_GECKOVIEW_RELEASE.format(**subs)) + + return task + + +@index_builder('android-nightly') +def add_android_nightly_index_routes(config, task): + task = add_nightly_index_routes(config, task) + task = add_geckoview_index_routes(config, task) + + return task + + +@index_builder('android-nightly-with-multi-l10n') +def add_android_nightly_multi_index_routes(config, task): + task = add_nightly_multi_index_routes(config, task) + task = add_geckoview_index_routes(config, task) + + return task + + @transforms.add def add_index_routes(config, tasks): for task in tasks: