# 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/.
---
task-defaults:
    attributes:
        artifact_map: taskcluster/gecko_taskgraph/manifests/fennec_geckoview.yml
        maven_packages:
            - geckoview
    index:
        product: mobile
    worker-type: b-linux-docker-amd
    worker:
        docker-image: {in-tree: android-build}
        max-run-time: 7200
        env:
            GRADLE_USER_HOME: "/builds/worker/checkouts/gecko/mobile/android/gradle/dotgradle-offline"
        artifacts:
            - name: public/build/maven
              path: /builds/worker/workspace/obj-build/gradle/maven/
              type: directory
            - name: public/build/target.maven.zip
              path: /builds/worker/workspace/obj-build/gradle/target.maven.zip
              type: file
            - name: public/build/geckoview-androidTest.apk
              path: /builds/worker/workspace/obj-build/gradle/build/mobile/android/geckoview/outputs/apk/androidTest/debug/geckoview-debug-androidTest.apk
              type: file
            - name: public/build/geckoview-test_runner.apk
              path: /builds/worker/workspace/obj-build/gradle/build/mobile/android/test_runner/outputs/apk/debug/test_runner-debug.apk
              type: file
            - name: public/build/geckoview-test_runner.aab
              path: /builds/worker/workspace/obj-build/gradle/build/mobile/android/test_runner/outputs/bundle/debug/test_runner-debug.aab
              type: file
            - name: public/build/geckoview_example.apk
              path: /builds/worker/workspace/obj-build/gradle/build/mobile/android/geckoview_example/outputs/apk/debug/geckoview_example-debug.apk
              type: file
            - name: public/build/geckoview_example.aab
              path: /builds/worker/workspace/obj-build/gradle/build/mobile/android/geckoview_example/outputs/bundle/debug/geckoview_example-debug.aab
              type: file
            - name: public/build
              path: /builds/worker/artifacts/
              type: directory
            - name: public/reports
              path: /builds/worker/workspace/obj-build/gradle/build/reports
              type: directory
    run-on-repo-type: [hg]
    run:
        using: mozharness
        script: "mozharness/scripts/fx_desktop_build.py"
        config: ["builds/releng_base_android_64_builds.py"]
        secrets: true
        tooltool-downloads: internal
    fetches:
        toolchain:
            - android-ndk-linux
            - android-sdk-linux
            - linux64-jdk
            - linux64-rust-android
            - linux64-rust-size
            - linux64-cbindgen
            - linux64-dump_syms
            - linux64-nasm
            - linux64-node
            - sysroot-x86_64-linux-gnu
            - sysroot-wasm32-wasi

android-arm/debug:
    description: "Android Arm Debug"
    index:
        job-name: android-arm-debug
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-armv7/debug
        symbol: B
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: arm-debug
        mozconfig-variant: debug
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies

android-arm/opt:
    description: "Android Arm Opt"
    index:
        job-name: android-arm-opt
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-armv7/opt
        symbol: B
    run-on-projects: ['integration']
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: arm
    use-sccache: true
    use-python: "3.11"
    fetches:
        toolchain:
            - linux64-clang
            - android-gradle-dependencies
            - linux64-sccache

android-arm-lite/opt:
    description: "Android Arm Opt Lite"
    index:
        job-name: android-arm-lite-opt
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-armv7/opt
        symbol: Bl
    run-on-projects: ['integration']
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            PERFHERDER_EXTRA_OPTIONS: lite
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: arm-lite
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies-lite

android-arm-shippable/opt:
    description: "Android Arm Shippable"
    use-pgo: android-arm-shippable/opt
    attributes:
        enable-full-crashsymbols: true
        shippable: true
    shipping-phase: build
    shipping-product: fennec
    index:
        job-name: android-arm-opt
        type: android-shippable-with-multi-l10n
    treeherder:
        platform: android-5-0-armv7-shippable/opt
        symbol: Bpgo(B)
    run-on-projects: ['release']
    worker-type: b-linux-docker-xlarge-amd
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build, multi-l10n]
        config: [taskcluster_nightly.py]
        custom-build-variant-cfg: arm
    fetches:
        toolchain:
            - linux64-clang
            - android-gradle-dependencies

android-arm-shippable-lite/opt:
    description: "Android Arm Shippable Lite"
    use-pgo: android-arm-shippable/opt
    attributes:
        enable-full-crashsymbols: true
        shippable: true
    shipping-phase: build
    shipping-product: fennec
    index:
        job-name: android-arm-lite-opt
        type: android-shippable-with-multi-l10n
    treeherder:
        platform: android-5-0-armv7-shippable/opt
        symbol: Bpgo(Bl)
    run-on-projects: ['release']
    worker-type: b-linux-docker-xlarge-amd
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
            PERFHERDER_EXTRA_OPTIONS: lite
    run:
        actions: [get-secrets, build, multi-l10n]
        config: [taskcluster_nightly.py]
        custom-build-variant-cfg: arm-lite
    fetches:
        toolchain:
            - linux64-clang
            - android-gradle-dependencies-lite

android-aarch64/opt:
    description: "Android AArch64 Opt"
    index:
        job-name: android-aarch64-opt
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-aarch64/opt
        symbol: B
    run-on-projects: ['integration']
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: aarch64
    use-sccache: true
    use-python: "3.11"
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies

android-aarch64-lite/opt:
    description: "Android AArch64 Opt Lite"
    index:
        job-name: android-aarch64-lite-opt
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-aarch64/opt
        symbol: Bl
    run-on-projects: ['integration']
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            PERFHERDER_EXTRA_OPTIONS: lite
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: aarch64-lite
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies-lite

android-aarch64-non-unified/opt:
    description: "Android AArch64 Opt Non-unified"
    index:
        job-name: android-aarch64-non-unified
    treeherder:
        platform: android-5-0-aarch64/opt
        symbol: B-nu
    run-on-projects: ['integration']
    worker:
        env:
            MOZ_AUTOMATION_BUILD_SYMBOLS: '0'
            PERFHERDER_EXTRA_OPTIONS: non-unified
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: aarch64
        extra-config:
            extra_mozconfig_content:
                - ac_add_options --disable-unified-build
    use-sccache: true
    use-python: "3.11"
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies

android-aarch64/debug:
    description: "Android AArch64 Debug"
    index:
        job-name: android-aarch64-debug
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-aarch64/debug
        symbol: B
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: aarch64-debug
        mozconfig-variant: debug
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies

android-aarch64-shippable/opt:
    description: "Android AArch64 Shippable"
    use-pgo: android-aarch64-shippable/opt
    attributes:
        enable-full-crashsymbols: true
        shippable: true
    shipping-phase: build
    shipping-product: fennec
    index:
        job-name: android-aarch64-opt
        type: android-shippable
    treeherder:
        platform: android-5-0-aarch64-shippable/opt
        symbol: Bpgo(B)
    run-on-projects: ['release']
    worker-type: b-linux-docker-xlarge-amd
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build, multi-l10n]
        config: [taskcluster_nightly.py]
        custom-build-variant-cfg: aarch64
    fetches:
        toolchain:
            - linux64-clang
            - android-gradle-dependencies

android-aarch64-shippable-lite/opt:
    description: "Android AArch64 Shippable Lite"
    use-pgo: android-aarch64-shippable/opt
    attributes:
        enable-full-crashsymbols: true
        shippable: true
    shipping-phase: build
    shipping-product: fennec
    index:
        job-name: android-aarch64-lite-opt
        type: android-shippable
    treeherder:
        platform: android-5-0-aarch64-shippable/opt
        symbol: Bpgo(Bl)
    run-on-projects: ['release']
    worker-type: b-linux-docker-xlarge-amd
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
            PERFHERDER_EXTRA_OPTIONS: lite
    run:
        actions: [get-secrets, build, multi-l10n]
        config: [taskcluster_nightly.py]
        custom-build-variant-cfg: aarch64-lite
    fetches:
        toolchain:
            - linux64-clang
            - android-gradle-dependencies-lite

android-x86_64/opt:
    description: "Android x86-64 Opt"
    index:
        job-name: android-x86_64-opt
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-x86_64/opt
        symbol: B
    run-on-projects: ['integration']
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: x86_64
    use-sccache: true
    use-python: "3.11"
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies

android-x86_64-lite/opt:
    description: "Android x86-64 Opt Lite"
    index:
        job-name: android-x86_64-lite-opt
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-x86_64/opt
        symbol: Bl
    run-on-projects: ['integration']
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
            PERFHERDER_EXTRA_OPTIONS: lite
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: x86_64-lite
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies-lite

android-x86_64-fuzzing/debug:
    description: "Android x86_64 Fuzzing Debug"
    index:
        job-name: android-x86_64-fuzzing-debug
    treeherder:
        platform: android-5-0-x86_64/debug
        symbol: Bf
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
            PERFHERDER_EXTRA_OPTIONS: fuzzing
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: fuzzing-debug
        mozconfig-variant: debug-fuzzing
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies
    optimization:
        skip-unless-expanded: null

android-x86_64-non-unified/opt:
    description: "Android x86-64 Opt Non-unified"
    index:
        job-name: android-x86_64-non-unified
    treeherder:
        platform: android-5-0-x86_64/opt
        symbol: B-nu
    run-on-projects: ['integration']
    worker:
        env:
            MOZ_AUTOMATION_BUILD_SYMBOLS: '0'
            PERFHERDER_EXTRA_OPTIONS: non-unified
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: x86_64
        extra-config:
            extra_mozconfig_content:
                - ac_add_options --disable-unified-build
    use-sccache: true
    use-python: "3.11"
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies

android-x86_64-shippable/opt:
    description: "Android x86-64 Shippable"
    use-pgo: true
    attributes:
        enable-full-crashsymbols: true
        shippable: true
    shipping-phase: build
    shipping-product: fennec
    index:
        job-name: android-x86_64-opt
        type: android-shippable
    treeherder:
        platform: android-5-0-x86_64-shippable/opt
        symbol: Bpgo(B)
    run-on-projects: ['release']
    worker-type: b-linux-docker-xlarge-amd
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build, multi-l10n]
        config: [taskcluster_nightly.py]
        custom-build-variant-cfg: x86_64
    fetches:
        toolchain:
            - linux64-clang
            - android-gradle-dependencies

android-x86_64-shippable-lite/opt:
    description: "Android x86-64 Shippable Lite"
    use-pgo: android-x86_64-shippable/opt
    attributes:
        enable-full-crashsymbols: true
        shippable: true
    shipping-phase: build
    shipping-product: fennec
    index:
        job-name: android-x86_64-lite-opt
        type: android-shippable
    treeherder:
        platform: android-5-0-x86_64-shippable/opt
        symbol: Bpgo(Bl)
    run-on-projects: ['release']
    worker-type: b-linux-docker-xlarge-amd
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
            PERFHERDER_EXTRA_OPTIONS: lite
    run:
        actions: [get-secrets, build, multi-l10n]
        config: [taskcluster_nightly.py]
        custom-build-variant-cfg: x86_64-lite
    fetches:
        toolchain:
            - linux64-clang
            - android-gradle-dependencies-lite

android-x86_64/debug:
    description: "Android x86-64 Debug"
    index:
        job-name: android-x86_64-debug
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-x86_64/debug
        symbol: B
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: x86_64-debug
        mozconfig-variant: debug
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies

android-x86_64/debug-isolated-process:
    description: "Android x86-64 Debug with Isolated Process"
    index:
        job-name: android-x86_64-debug-isolated-process
    attributes:
        enable-full-crashsymbols: true
    treeherder:
        platform: android-5-0-x86_64/debug
        symbol: Bip
    worker:
        env:
            TOOLTOOL_MANIFEST: "mobile/android/config/tooltool-manifests/android-x86/releng.manifest"
            MOZ_AUTOMATION_PACKAGE_TESTS: "1"
            PERFHERDER_EXTRA_OPTIONS: isolated-process
    run:
        actions: [get-secrets, build]
        custom-build-variant-cfg: x86_64-debug-isolated-process
        mozconfig-variant: debug-isolated-process
    use-sccache: true
    fetches:
        toolchain:
            - linux64-clang
            - linux64-sccache
            - android-gradle-dependencies
