# 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/.

implementation: taskgraph.task.transform:TransformTask

transforms:
   - taskgraph.transforms.build_attrs:transforms
   - taskgraph.transforms.job:transforms
   - taskgraph.transforms.task:transforms

job-defaults:
    index:
        product: firefox
    treeherder:
        symbol: S
        kind: build
        tier: 1

jobs:
    macosx64-st-an/debug:
        description: "MacOS X x64 Debug Cross-compile Static Analysis"
        index:
            job-name: macosx64-st-an-debug
        treeherder:
            platform: osx-10-7/debug
        worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
        worker:
            implementation: docker-worker
            docker-image: {in-tree: desktop-build}
            max-run-time: 36000
        run:
            using: mozharness
            actions: [build generate-build-stats update]
            config:
                - builds/releng_base_mac_64_cross_builds.py
                - balrog/production.py
            # enables static analysis.
            custom-build-variant-cfg: cross-debug-st-an
            script: "mozharness/scripts/fx_desktop_build.py"
            tooltool-downloads: internal
            keep-artifacts: false

    macosx64-st-an/opt:
        description: "MacOS X x64 Opt Cross-compile Static Analysis"
        index:
            job-name: macosx64-st-an-opt
        treeherder:
            platform: osx-10-7/opt
        worker-type: aws-provisioner-v1/gecko-{level}-b-macosx64
        worker:
            implementation: docker-worker
            docker-image: {in-tree: desktop-build}
            max-run-time: 36000
        run:
            using: mozharness
            actions: [build generate-build-stats update]
            config:
                - builds/releng_base_mac_64_cross_builds.py
                - balrog/production.py
            # enables static analysis.
            custom-build-variant-cfg: cross-opt-st-an
            script: "mozharness/scripts/fx_desktop_build.py"
            tooltool-downloads: internal
            keep-artifacts: false

    linux64-st-an/debug:
        description: "Linux64 Debug Static Analysis"
        index:
            job-name: linux64-st-an-debug
        treeherder:
            platform: linux64/debug
        worker-type: aws-provisioner-v1/gecko-{level}-b-linux
        worker:
            implementation: docker-worker
            docker-image: {in-tree: desktop-build}
            max-run-time: 36000
        run:
            using: mozharness
            actions: [build generate-build-stats]
            config:
                - builds/releng_sub_linux_configs/64_stat_and_debug.py
                - balrog/production.py
            script: "mozharness/scripts/fx_desktop_build.py"
            tooltool-downloads: public
            keep-artifacts: false

    linux64-st-an/opt:
        description: "Linux64 Opt Static Analysis"
        index:
            job-name: linux64-st-an-opt
        treeherder:
            platform: linux64/opt
        worker-type: aws-provisioner-v1/gecko-{level}-b-linux
        worker:
            implementation: docker-worker
            docker-image: {in-tree: desktop-build}
            max-run-time: 36000
        run:
            using: mozharness
            actions: [build generate-build-stats]
            config:
                - builds/releng_sub_linux_configs/64_stat_and_opt.py
                - balrog/production.py
            script: "mozharness/scripts/fx_desktop_build.py"
            tooltool-downloads: public
            keep-artifacts: false

    win32-st-an/debug:
        description: "Win32 Static Analysis Debug (clang-cl)"
        index:
            product: firefox
            job-name: win32-st-an-debug
        treeherder:
            platform: windows2012-32/debug
            symbol: tc(S)
            tier: 1
        worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
        worker:
            implementation: generic-worker
            max-run-time: 7200
        run:
            using: mozharness
            script: mozharness/scripts/fx_desktop_build.py
            config:
                - builds/taskcluster_firefox_win32_clang_debug.py

    win32-st-an/opt:
        description: "Win32 Static Analysis Opt (clang-cl)"
        index:
            product: firefox
            job-name: win32-st-an-opt
        treeherder:
            platform: windows2012-32/opt
            symbol: tc(S)
            tier: 1
        worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
        worker:
            implementation: generic-worker
            max-run-time: 7200
        run:
            using: mozharness
            script: mozharness/scripts/fx_desktop_build.py
            config:
                - builds/taskcluster_firefox_win32_clang.py

    win64-st-an/debug:
        description: "Win64 Static Analysis Debug (clang-cl)"
        index:
            product: firefox
            job-name: win64-st-an-debug
        treeherder:
            platform: windows2012-64/debug
            symbol: tc(S)
            tier: 1
        worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
        worker:
            implementation: generic-worker
            max-run-time: 7200
        run:
            using: mozharness
            script: mozharness/scripts/fx_desktop_build.py
            config:
                - builds/taskcluster_firefox_win64_clang_debug.py

    win64-st-an/opt:
        description: "Win64 Static Analysis Opt (clang-cl)"
        index:
            product: firefox
            job-name: win64-st-an-opt
        treeherder:
            platform: windows2012-64/opt
            symbol: tc(S)
            tier: 1
        worker-type: aws-provisioner-v1/gecko-{level}-b-win2012
        worker:
            implementation: generic-worker
            max-run-time: 7200
        run:
            using: mozharness
            script: mozharness/scripts/fx_desktop_build.py
            config:
                - builds/taskcluster_firefox_win64_clang.py
