# 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/.
---
loader: taskgraph.loader.transform:loader

transforms:
    - taskgraph.transforms.from_deps
    - gecko_taskgraph.transforms.name_sanity
    - gecko_taskgraph.transforms.beetmover_geckoview
    - gecko_taskgraph.transforms.task

kind-dependencies:
    - build-signing
    - upload-symbols

only-for-attributes:
    - nightly
    - shippable

not-for-build-platforms:
    - linux-shippable/opt
    - linux64-shippable/opt
    - linux64-aarch64-shippable/opt
    - linux64-nightlyasrelease/opt
    - macosx64-shippable/opt
    - macosx64-nightlyasrelease/opt
    - win32-shippable/opt
    - win64-shippable/opt
    - win64-aarch64-shippable/opt
    - win64-nightlyasrelease/opt
    - linux-devedition/opt
    - linux64-devedition/opt
    - macosx64-devedition/opt
    - win32-devedition/opt
    - win64-devedition/opt
    - win64-aarch64-devedition/opt
    - linux64-asan-reporter-shippable/opt
    - win64-asan-reporter-shippable/opt

tasks:
    beetmover-geckoview:
        from-deps:
            group-by: platform
        attributes:
            artifact_map: taskcluster/gecko_taskgraph/manifests/fennec_geckoview.yml
        run-on-projects: ['mozilla-release']
        run-on-hg-branches:
            by-project:
                mozilla-release:
                    - '^GECKOVIEW_\d+_RELBRANCH$'
                default:
                    - 'all'
        shipping-phase:
            by-project:
                # Beetmoving geckoview makes it available to the official maven repo.
                # That happens:
                # 1. as part of the nightly-android or nightly-all graph on mozilla-central
                # 2. as part of firefox-android ship graphs on both mozilla-beta and mozilla-release
                # 3. at every patch uplifted on the GECKOVIEW_XX_RELBRANCH on mozilla-release
                # Reminder: There is no Android/geckoview build on ESR.
                #
                # The logic of point 2 is handled in target_tasks directly because it's mixing and
                # matching 2 different shipping-products
                mozilla-release: build
                default: promote
        bucket-scope:
            by-release-level:
                production: 'project:releng:beetmover:bucket:maven-production'
                staging: 'project:releng:beetmover:bucket:maven-staging'
