# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
version: 91.1.1
git_hash: 17942945873cdb8be56a9316d3cb8a611b3ef321
git_url: https://github.com/mozilla/application-services
git_submodule: 1

var:
  container:
    use_container: 1
  # This should be updated when the list of gradle dependencies is changed.
  gradle_dependencies_version: 9
  gradle_version: 6.7.1
  glean_parser: 4.0.0
  arch_deps:
    - python3-venv

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: uniffi-rs
    name: uniffi-rs
    pkg_type: build
  - project: nss
    name: nss-armv7
    pkg_type: build
    target_prepend:
      - android-armv7
  - project: nss
    name: nss-aarch64
    pkg_type: build
    target_prepend:
      - android-aarch64
  - project: nss
    name: nss-x86
    pkg_type: build
    target_prepend:
      - android-x86
  - project: nss
    name: nss-x86_64
    pkg_type: build
    target_prepend:
      - android-x86_64
  - project: nss
    name: nss-linux-x86_64
    pkg_type: build
    target_prepend:
      - nss-linux-x86_64
  - project: sqlcipher
    name: sqlcipher-armv7
    pkg_type: build
    target_prepend:
      - android-armv7
  - project: sqlcipher
    name: sqlcipher-aarch64
    pkg_type: build
    target_prepend:
      - android-aarch64
  - project: sqlcipher
    name: sqlcipher-x86
    pkg_type: build
    target_prepend:
      - android-x86
  - project: sqlcipher
    name: sqlcipher-x86_64
    pkg_type: build
    target_prepend:
      - android-x86_64
  - project: sqlcipher
    name: sqlcipher-linux-x86_64
    pkg_type: build
    target_prepend:
      - sqlcipher-linux-x86_64
      - nss-linux-x86_64
  - 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") %]'
  # Use `make cargo_vendor-application-services` to re-generate the vendor tarball
  - URL: https://people.torproject.org/~aguestuser/mirrors/sources/application-services-vendor-[% c('version') %].tar.bz2
    sha256sum: 621fef6c07bbb0b165cbc4dfa44176ff7d1d04557f7c418a0a809a29099c6440
  - filename: no-git.patch
  - filename: mavenLocal.patch
    enable: '[% !c("var/fetch_gradle_dependencies") %]'
  - filename: gen_gradle_deps_file.sh
    enable: '[% c("var/fetch_gradle_dependencies") %]'

steps:
  list_toolchain_updates:
    git_hash: 'v91.1.0'
    input_files: []
    var:
      container:
        use_container: 0
      get_android_components_version: |
        #!/bin/bash
        read -d '' p << 'EOF' || true
        if (m/^\\s*android_components_version\\s=\\s'([^']*)'/) {
          print $1;
          exit;
        }
        EOF
        perl -ne "$p" < build.gradle
      android_components_version: '[% exec(c("var/get_android_components_version")) %]'
      glean_version: '[% pc("android-components", "var/glean_version", { git_hash => "v" _ c("var/android_components_version") }) %]'
    input_files:
      - name: glean
        project: glean
        pkg_type: src

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

  cargo_vendor:
    filename: '[% project %]-vendor-[% c("version") %].tar.bz2'
    input_files:
      - project: container-image
        pkg_type: build
      - project: rust
        name: rust
        pkg_type: build
