# 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/.
---
# This file contains information about all the release artifacts that are
# needed within a type of release.
#
# Structure
# --------
# `bucket_paths`          -- prefix to be used per product to correctly access our buckets
# `default_locales`       -- list of locales to be used when composing upstream artifacts or the list of
#                      destinations. If given an empty locale, it uses these locales instead.
# `tasktype_map`          -- mapping between task reference and task type, particularly useful when
#                      composing the upstreamArtifacts for scriptworker.
# `platform_names`        -- various platform mappings used in reckoning artifacts or other paths
# `default`               -- a default entry, which the mappings extend and override in such a way that
#                      final path full-destinations will be a concatenation of the following:
#                      `bucket_paths`, `destinations`, `locale_prefix`, `pretty_name`
# `mapping`               -- the main section defining all artifacts to be archived
#
# Per-artifact fields (used within `mapping`):
# `from`                  -- specifies the dependency(ies) from which to expect the particular artifact
# `all_locales`           -- boolean argument to specify whether that particular artifact is to be expected
#                      for all locales or just the default one
# `description`           -- brief summary of what that artifact is
# `locale_prefix`         -- prefix to be used in the final destination paths, whether that's for default locale or not
# `source_path_modifier`  -- any parent dir that might be used in between artifact prefix and filename at source location
#                            for example `public/build` vs `public/build/ach/`.
# `destinations`          -- final list of directories where to push the artifacts
# `pretty_name`           -- the final name the artifact will have at destination
# `checksums_path`        -- the name to identify one artifact within the checksums file
# `not_for_platforms`     -- filtering option to avoid associating an artifact with a specific platform
# `only_for_platforms`    -- filtering option to exclusively include the association of an artifact for a specific platform

bucket_paths:
    by-build-type:
        fenix-nightly:
            - pub/fenix/nightly
        fenix-(release|beta):
            - pub/fenix/candidates
        focus-nightly:
            - pub/focus/nightly
        focus-beta|focus-release|klar-release:
            - pub/focus/candidates
folder_prefix:
    by-build-type:
        .*nightly.*: '${year}/${month}/${upload_date}-'
        default: '${version}-candidates/build${build_number}/android/'
default_locales:
    - multi
tasktype_map:
    signing-apk: signing
    signing-bundle: signing
platform_names:
    product:
        by-platform:
            focus.*: focus
            fenix.*: fenix
            klar.*: klar

default: &default
    all_locales: true
    description: "TO_BE_OVERRIDDEN"
    locale_prefix: ''
    source_path_modifier:
        by-locale:
            default: '${locale}'
            multi: ''
    checksums_path: "TODO"

mapping:
    target.arm64-v8a.apk:
        <<: *default
        description: "Android package for arm64-v8a"
        pretty_name: ${product}-${version}.${locale}.android-arm64-v8a.apk
        destinations:
            - ${folder_prefix}${product}-${version}-android-arm64-v8a
        from:
            - signing-apk
    target.armeabi-v7a.apk:
        <<: *default
        description: "Android package for armeabi-v7a"
        pretty_name: ${product}-${version}.${locale}.android-armeabi-v7a.apk
        destinations:
            - ${folder_prefix}${product}-${version}-android-armeabi-v7a
        from:
            - signing-apk
    target.x86_64.apk:
        <<: *default
        description: "Android package for x86_64"
        pretty_name: ${product}-${version}.${locale}.android-x86_64.apk
        destinations:
            - ${folder_prefix}${product}-${version}-android-x86_64
        from:
            - signing-apk
    target.universal.apk:
        <<: *default
        description: "Android universal package"
        pretty_name: ${product}-${version}.${locale}.android-universal.apk
        destinations:
            - ${folder_prefix}${product}-${version}-android
        from:
            - signing-apk
        only_for_platforms:
            - fenix-nightly
            - fenix-beta
            - fenix-release
    target.aab:
        <<: *default
        description: "Android app bundle"
        pretty_name: ${product}-${version}.${locale}.android.aab
        destinations:
            - ${folder_prefix}${product}-${version}-android
        from:
            - signing-bundle
