# 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.single_dep:loader

transforms:
   - taskgraph.transforms.l10n:transforms
   - taskgraph.transforms.use_toolchains:transforms
   - taskgraph.transforms.job:transforms
   - taskgraph.transforms.task:transforms

kind-dependencies:
   - build
   - toolchain

only-for-build-platforms:
   - linux64-nightly/opt
   - linux-nightly/opt
   - android-api-16-nightly/opt
   - macosx64-nightly/opt
   - win32-nightly/opt
   - win64-nightly/opt
   - linux64-devedition-nightly/opt
   - linux-devedition-nightly/opt
   - macosx64-devedition-nightly/opt
   - win32-devedition-nightly/opt
   - win64-devedition-nightly/opt

job-template:
   description:
      by-build-platform:
         default: Localization
         android-api-16-nightly: Single Locale Repack
   locales-file:
      by-build-platform:
         default: browser/locales/l10n-changesets.json
         android-api-16-nightly: mobile/locales/l10n-changesets.json
   locales-per-chunk: 5
   run-on-projects: ['release']
   attributes:
      shipping_phase: promote
   ignore-locales:
      by-build-platform:
         # OSX has a special locale for japanese
         macosx64.*: [ja]
         default: [ja-JP-mac]
   run-time:
      by-build-platform:
         default: 36000
         android-api-16-nightly: 18000
   docker-image:
      by-build-platform:
         android-api-16-nightly:
            in-tree: android-build
         default: null
   secrets:
      by-build-platform:
         default: false
         android-api-16-nightly: true
   toolchains:
      by-build-platform:
         default: []
         macosx64.*:
            - linux64-libdmg
            - linux64-hfsplus
         android-api-16-nightly:
            - android-gradle-dependencies
            - android-sdk-linux
            - proguard-jar
   tooltool:
      by-build-platform:
         default: public
         android-api-16-nightly: internal
         macosx64-nightly: internal
         macosx64-devedition-nightly: internal
         win32-nightly: internal
         win32-devedition-nightly: internal
         win64-nightly: internal
         win64-devedition-nightly: internal
   index:
      type: nightly-l10n
      product:
         by-build-platform:
            default: firefox
            .*-devedition-.*: devedition
            android-api-16-nightly: mobile
      job-name:
         by-build-platform:
            linux-nightly: linux-opt
            linux64-nightly: linux64-opt
            macosx64-nightly: macosx64-opt
            win32-nightly: win32-opt
            win64-nightly: win64-opt
            linux-devedition-nightly: linux-devedition-opt
            linux64-devedition-nightly: linux64-devedition-opt
            macosx64-devedition-nightly: macosx64-devedition-opt
            win32-devedition-nightly: win32-devedition-opt
            win64-devedition-nightly: win64-devedition-opt
            android-api-16-nightly: android-api-16-opt
   worker-type:
      by-build-platform:
         default: aws-provisioner-v1/gecko-{level}-b-linux
         android-api-16-nightly: aws-provisioner-v1/gecko-{level}-b-android
         win.*: aws-provisioner-v1/gecko-{level}-b-win2012
   treeherder:
      symbol: L10n(N)
      tier: 1
      platform:
         by-build-platform:
            linux64-nightly: linux64/opt
            linux-nightly: linux32/opt
            macosx64-nightly: osx-cross/opt
            win32-nightly: windows2012-32/opt
            win64-nightly: windows2012-64/opt
            linux64-devedition-nightly: linux64-devedition/opt
            linux-devedition-nightly: linux32-devedition/opt
            macosx64-devedition-nightly: osx-cross-devedition/opt
            win32-devedition-nightly: windows2012-32-devedition/opt
            win64-devedition-nightly: windows2012-64-devedition/opt
            android-api-16-nightly: android-4-0-armv7-api16/opt
   env:
      by-build-platform:
         linux.*:   # linux64 and 32 get same treatment here
            EN_US_PACKAGE_NAME: target.tar.bz2
            EN_US_BINARY_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<signed-build>/artifacts/public/build
            MAR_TOOLS_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/host/bin
         macosx64.*:
            EN_US_PACKAGE_NAME: target.dmg
            EN_US_BINARY_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<repackage>/artifacts/public/build
            MAR_TOOLS_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/host/bin
         win.*:
            EN_US_PACKAGE_NAME: target.zip
            EN_US_BINARY_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<signed-build>/artifacts/public/build
            EN_US_INSTALLER_BINARY_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<repackage-signed>/artifacts/public/build
            MAR_TOOLS_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/host/bin
         android-api-16-nightly:
            EN_US_PACKAGE_NAME: target.apk
            EN_US_BINARY_URL:
               task-reference: https://queue.taskcluster.net/v1/task/<unsigned-build>/artifacts/public/build/en-US
   mozharness:
      config:
         by-build-platform:
            linux-nightly:
               - single_locale/tc_linux32.py
               - taskcluster_nightly.py
            linux64-nightly:
               - single_locale/tc_linux64.py
               - taskcluster_nightly.py
            macosx64-nightly:
               - single_locale/tc_macosx64.py
               - taskcluster_nightly.py
            win32-nightly: []
            win64-nightly: []
            linux-devedition-nightly:
               - single_locale/tc_linux32.py
               - taskcluster_nightly.py
            linux64-devedition-nightly:
               - single_locale/tc_linux64.py
               - taskcluster_nightly.py
            macosx64-devedition-nightly:
               - single_locale/tc_macosx64.py
               - taskcluster_nightly.py
            win32-devedition-nightly: []
            win64-devedition-nightly: []
            android-api-16-nightly:
               - taskcluster_nightly.py
               - single_locale/{project}_android-api-16.py
               - single_locale/tc_android-api-16.py
      # no default, so we fail on new entries
      options:
         by-build-platform:
            linux-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/linux32.py
            linux64-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/linux64.py
            macosx64-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/macosx64.py
            win32-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/win32.py
               - config=single_locale/tc_win32.py
               - config=taskcluster_nightly.py
               - revision=$GECKO_HEAD_REV
            win64-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/win64.py
               - config=single_locale/tc_win64.py
               - config=taskcluster_nightly.py
               - revision=$GECKO_HEAD_REV
            linux-devedition-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/linux_devedition.py
            linux64-devedition-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/linux64_devedition.py
            macosx64-devedition-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/macosx64_devedition.py
            win32-devedition-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/win32_devedition.py
               - config=single_locale/tc_win32.py
               - config=taskcluster_nightly.py
               - revision=$GECKO_HEAD_REV
            win64-devedition-nightly:
               - environment-config=single_locale/production.py
               - branch-config=single_locale/{project}.py
               - platform-config=single_locale/win64_devedition.py
               - config=single_locale/tc_win64.py
               - config=taskcluster_nightly.py
               - revision=$GECKO_HEAD_REV
            default: []
      actions:
         by-build-platform:
            default: ['clone-locales', 'list-locales', 'setup', 'repack',
                      'submit-to-balrog', 'summary']
            android-api-16-nightly: ['get-secrets',
                                     'clone-locales', 'list-locales', 'setup', 'repack',
                                     'upload-repacks', 'submit-to-balrog', 'summary']
      script:
         by-build-platform:
            default: mozharness/scripts/desktop_l10n.py
            android-api-16-nightly: mozharness/scripts/mobile_l10n.py
   notifications:
      completed:
         subject: "COMPLETED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         message: "COMPLETED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         plugins:
            by-project:
               mozilla-beta: ["log_collect"]
               mozilla-release: ["log_collect"]
               default: []

      failed:
         subject: "FAILED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         message: "FAILED: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         plugins:
            by-project:
               mozilla-beta: ["log_collect", "ses"]
               mozilla-release: ["log_collect", "ses"]
               default: ["ses"]
         emails:
            by-project:
               mozilla-beta: ["release-automation-notifications@mozilla.com"]
               mozilla-release: ["release-automation-notifications@mozilla.com"]
               try: ["{task_def[metadata][owner]}"]
               maple: ["release+tcstaging@mozilla.com"]
               default: []

      exception:
         subject: "EXCEPTION: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         message: "EXCEPTION: [{task[shipping-product]} {release_config[version]} build{release_config[build_number]}/{config[params][project]}] {task_def[metadata][name]} task"
         plugins:
            by-project:
               mozilla-beta: ["log_collect", "ses"]
               mozilla-release: ["log_collect", "ses"]
               default: ["ses"]
         emails:
            by-project:
               mozilla-beta: ["release-automation-notifications@mozilla.com"]
               mozilla-release: ["release-automation-notifications@mozilla.com"]
               try: ["{task_def[metadata][owner]}"]
               maple: ["release+tcstaging@mozilla.com"]
               default: []
