# vim: filetype=yaml sw=2
version: 128.0.1
git_hash: 0e4777f4133a98f44bca164fcf0406e8f706dbe4
git_url: https://github.com/mozilla/application-services
git_submodule: 1
container:
  use_container: 1

var:
  # This should be updated when the list of gradle dependencies is changed.
  gradle_dependencies_version: 11
  gradle_version: 8.8
  glean_parser: 14.0.1
  nss_version: '3.101'
  nspr_version: '4.35'

steps:
  build:
    filename: '[% project %]-[% c("version") %]-[% c("var/rebuild_date") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]'
    var:
      # Due to some issue in application-service causing non matching
      # builds when build time differ a lot, we need to do periodic rebuilds:
      # https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/merge_requests/937#note_3009480
      rebuild_date: '2024-09-12'
      arch_deps:
        # Needed to build NSS
        - gyp
    input_files:
      - project: container-image
        pkg_type: build
      - project: '[% c("var/compiler") %]'
        name: '[% c("var/compiler") %]'
        pkg_type: build
      - project: gradle
        name: gradle
        pkg_type: build
      - project: rust
        name: rust
        pkg_type: build
      - project: ninja
        name: ninja
        pkg_type: build
      - project: uniffi-rs
        name: uniffi-rs
        pkg_type: build
      # Only Application Services currently requires build tools 30.0.3.
      # So, download them only here, rather than adding them to the shared
      # toolchain.
      - URL: 'https://dl.google.com/android/repository/build-tools_r30.0.3-linux.zip'
        name: build_tools_30
        sha256sum: 24593500aa95d2f99fb4f10658aae7e65cb519be6cd33fa164f15f27f3c4a2d6
      # NSS version ans sha256 are in libs/build-all.sh.
      - URL: 'https://ftp.mozilla.org/pub/security/nss/releases/NSS_[% c("var/nss_version") | replace("\\.", "_") %]_RTM/src/nss-[% c("var/nss_version") %]-with-nspr-[% c("var/nspr_version") %].tar.gz'
        name: nss
        sha256sum: 566faa9283ff3d9a7d6c44272df6e4330e3e06ca4e841a68840d31b27c9161c4
      - filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]'
        name: gradle-dependencies
        exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
        enable: '[% !c("var/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 }) %]'
        enable: '[% !c("var/fetch_gradle_dependencies") %]'
      - name: cargo_vendor
        project: application-services
        pkg_type: cargo_vendor
        norec:
          sha256sum: 92ce1131b35bf78d86362670ba7e4930ecdd1117694996d7cce850e4860f90b6
      - filename: local-repository.diff
        enable: '[% !c("var/fetch_gradle_dependencies") %]'
      - filename: gen_gradle_deps_file.sh
        enable: '[% c("var/fetch_gradle_dependencies") %]'
      - filename: bug_13028.patch
      - filename: apply-bug-13028.diff
      # Delete when this patch is included upstream
      - filename: bug40485-nimbus-fml-reproducibility.diff
      - filename: no-ndk-lookup.diff
      # as-ohttp-client lists both the version for ohttp and a git repo + rev,
      # but this breaks the vendoring for offline builds.
      - filename: ohttp-no-git.diff
      - filename: offline-nimbus-fml.diff
      - filename: glean-noop.diff
      - filename: a-s-noop.diff
      - filename: cargo-no-build.sh
      - filename: 41422-disable-viaduct.diff

  list_toolchain_updates:
    git_hash: 'v[% c("version") %]'
    input_files: []
    container:
      use_container: 0

  get_gradle_dependencies_list:
    filename: 'gradle-dependencies-list-[% c("version") %].txt'
    get_gradle_dependencies_list: '[% INCLUDE build %]'
    var:
      fetch_gradle_dependencies: 1
