# 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.repackage_set_upstream_mac_kind
    - gecko_taskgraph.transforms.name_sanity
    - gecko_taskgraph.transforms.repackage
    - gecko_taskgraph.transforms.repackage_routes
    - gecko_taskgraph.transforms.job
    - gecko_taskgraph.transforms.task

kind-dependencies:
    - build-signing
    - build-mac-signing
    - build-mac-notarization
    - toolchain

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

tasks:
    repackage:
        from-deps:
            group-by: single-with-filters
        upstream-mac-kind:
            by-build-type:
                debug: build-mac-signing
                default:
                    by-project:
                        mozilla-(central|beta|release|esr.*): build-mac-notarization
                        default: build-mac-signing
        worker-type: b-linux-gcp
        worker:
            max-run-time:
                by-build-platform:
                    .*asan.*: 2700
                    default: 900
        mozharness:
            config:
                by-build-platform:
                    linux\b.*:
                        - repackage/base.py
                        - repackage/linux32_signed.py
                    linux64\b.*:
                        - repackage/base.py
                        - repackage/linux64_signed.py
                    macosx64\b.*:
                        - repackage/base.py
                        - repackage/osx_signed.py
                    win32\b.*:
                        - repackage/base.py
                        - repackage/win32_sfx_stub.py
                        - repackage/win32_signed.py
                    win64(?!-aarch64)\b.*:
                        - repackage/base.py
                        - repackage/win32_sfx_stub.py
                        - repackage/win64_signed.py
                    win64-aarch64\b.*:
                        - repackage/base.py
                        - repackage/win64-aarch64_sfx_stub.py
                        - repackage/win64_signed.py
        package-formats:
            by-build-platform:
                macosx64\b.*:
                    by-build-type:
                        # Debug builds can't be attributable
                        debug: [dmg, mar, pkg]
                        default: [dmg-attrib, mar, pkg]
                linux.*: [mar]
                win32\b.*: [mar, installer]
                win64\b.*: [mar, installer]
        fetches:
            toolchain:
                - linux64-mar-tools
                - linux64-upx
