# 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:
    - android_taskgraph.transforms.build_android_app:transforms
    - gecko_taskgraph.transforms.job:transforms
    - gecko_taskgraph.transforms.task:transforms

kind-dependencies:
    - toolchain
    - build-fat-aar
    - generate-baseline-profile-firebase

task-defaults:
    attributes:
        retrigger: true
    fetches:
        toolchain:
            - linux64-android-sdk-linux-repack
            - linux64-jdk-repack
            - linux64-node
    run:
        using: gradlew
    treeherder:
        kind: test
        tier: 1

tasks:
    fenix:
        description: 'Generate macrobenchmark apks for fenix with baseline profile.'
        attributes:
            shipping-product: fenix
        dependencies:
            build-fat-aar: build-fat-aar-android-geckoview-fat-aar/opt
            baseline-profile: generate-baseline-profile-firebase-fenix
        fetches:
            baseline-profile:
                - artifact: baselineProfile.tar.zst
                  dest: baselineProfiles
        source-project-name: "fenix"
        run:
            gradle-package-command: ":benchmark:assembleBenchmark :app:assembleBenchmark"
            baseline-profile-path: /builds/worker/fetches/baselineProfiles
        treeherder:
            symbol: fenix(instr)
            platform: fenix-android-all/opt
        worker:
            artifacts:
                - name: "public/build/target.arm64-v8a.apk"
                  path: "/builds/worker/workspace/obj-build/gradle/build/mobile/android/fenix/app/outputs/apk/fenix/benchmark/app-fenix-arm64-v8a-benchmark.apk"
                  type: "file"
                - name: "public/build/target.noarch.apk"
                  path: "/builds/worker/workspace/obj-build/gradle/build/mobile/android/fenix/benchmark/outputs/apk/benchmark/benchmark-benchmark.apk"
                  type: "file"
            chain-of-trust: true
