# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
filename: 'geckoview-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
git_hash: 'tor-browser-[% c("var/geckoview_version") %]-[% c("var/browser_branch") %]-build[% c("var/browser_build") %]'
tag_gpg_id: 1
git_url: https://gitlab.torproject.org/tpo/applications/tor-browser.git
gpg_keyring:
  - boklm.gpg
  - brizental.gpg
  - clairehurst.gpg
  - dan_b.gpg
  - ma1.gpg
  - morgan.gpg
  - pierov.gpg
container:
  use_container: 1
  disable_network:
    build_apk: 1

var:
  firefox_platform_version: '128.10.0'
  geckoview_version: '[% c("var/firefox_platform_version") %]esr'
  browser_series: '14.5'
  browser_rebase: 1
  browser_branch: '[% c("var/browser_series") %]-[% c("var/browser_rebase") %]'
  browser_build: 1
  gitlab_project: https://gitlab.torproject.org/tpo/applications/tor-browser
  git_commit: '[% exec("git rev-parse " _ c("git_hash") _ "^{commit}", { exec_noco => 1 }) %]'
  deps:
    - build-essential
    - autoconf
    - yasm
    - python3
    - python3-distutils
    - python3-venv
    - pkg-config
    - openjdk-17-jdk-headless
  # this should be updated when the list of gradle dependencies is changed
  # see doc/how-to-create-gradle-dependencies-list.txt
  gradle_dependencies_version: 16
  gradle_version: 8.8
  glean_parser: 14.0.1
  variant: beta
  has_l10n: '[% !c("var/testbuild") && !c("var/locales").empty %]'
  l10n-changesets: '[% exec("git --no-pager show " _ c("git_hash") _ ":browser/locales/l10n-changesets.json", { exec_noco => 1 }) %]'

targets:
  release:
    var:
      variant: release
  nightly:
    git_hash: 'tor-browser-[% c("var/geckoview_version") %]-[% c("var/browser_branch") %]'
    tag_gpg_id: 0
    var:
      variant: nightly

steps:
  build_apk:
    filename: 'geckoview-[% c("version") %]-apks-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
    version: '[% c("abbrev") %]'
    build_apk: '[% INCLUDE build_apk %]'
    input_files:
      - project: container-image
        pkg_type: build
      - name: '[% c("var/compiler") %]'
        project: '[% c("var/compiler") %]'
        pkg_type: build
      - project: gradle
        name: gradle
        pkg_type: build
      - project: node
        name: node
        pkg_type: build
      - project: application-services
        name: application-services
        pkg_type: build
      - filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]'
        name: gradle-dependencies
        exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
      - name: geckoview_armv7
        project: geckoview
        pkg_type: build
        target_prepend:
          - torbrowser-android-armv7
      - name: geckoview_aarch64
        project: geckoview
        pkg_type: build
        target_prepend:
          - torbrowser-android-aarch64
      - name: geckoview_x86
        project: geckoview
        pkg_type: build
        target_prepend:
          - torbrowser-android-x86
      - name: geckoview_x86_64
        project: geckoview
        pkg_type: build
        target_prepend:
          - torbrowser-android-x86_64
      - project: firefox-l10n
        name: firefox-l10n
        enable: '[% c("var/has_l10n") %]'
        pkg_type: build
        target_prepend:
          - torbrowser-android-armv7
      - name: translation-fenix
        project: translation
        pkg_type: fenix
        enable: '[% c("var/has_l10n") %]'
      - name: translation-tor-browser
        project: translation
        pkg_type: tor-browser
        enable: '[% c("var/has_l10n") %]'
      - filename: rename-branding-strings.py
      - URL: '[% pc("glean", "var/glean_wheels_url/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]'
        name: glean-wheels
        sha256sum: '[% pc("glean", "var/glean_wheels_sha256sum/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]'
      - name: tor-expert-bundle-aar
        project: tor-expert-bundle-aar
        pkg_type: build
      - project: oss-licenses-plugin
        name: oss-licenses-plugin
        pkg_type: build

  list_toolchain_updates:
    git_hash: tor-browser-128.0b1-14.0-1
    tag_gpg_id: 0
    input_files: []
    container:
      use_container: 0

input_files:
  - project: container-image
  - name: '[% c("var/compiler") %]'
    project: '[% c("var/compiler") %]'
  - project: gradle
    name: gradle
  - project: rust
    name: rust
  - project: cbindgen
    name: cbindgen
  - project: node
    name: node
  - project: nasm
    name: nasm
  - project: clang-linux
    name: clang
  - project: wasi-sysroot
    name: wasi-sysroot
    enable: '[% c("var/rlbox") %]'
  - project: application-services
    name: application-services
  - filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]'
    name: gradle-dependencies
    exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
  - URL: '[% pc("glean", "var/glean_wheels_url/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]'
    name: glean-wheels
    sha256sum: '[% pc("glean", "var/glean_wheels_sha256sum/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]'
  - project: oss-licenses-plugin
    name: oss-licenses-plugin
  - name: tor-expert-bundle-aar
    project: tor-expert-bundle-aar
    enable: '[% c("var/android_single_arch") %]'
  - project: firefox-l10n
    name: firefox-l10n
    enable: '[% c("var/android_single_arch") && c("var/has_l10n") %]'
  - name: translation-fenix
    project: translation
    pkg_type: fenix
    enable: '[% c("var/android_single_arch") && c("var/has_l10n") %]'
  - name: translation-tor-browser
    project: translation
    pkg_type: tor-browser
    enable: '[% c("var/android_single_arch") && c("var/has_l10n") %]'
  - filename: rename-branding-strings.py
