code:
#!/bin/bash

# compileSdkVersion
read -d '' p << 'EOF' || true
if (m/compileSdkVersion:\\s+(.*)$/) {
  print $1;
  exit;
}
EOF
needed=$(cat .config.yml | perl -ne "$p")
current=31
check_update_needed compileSdkVersion "$needed" "$current"

# targetSdkVersion
read -d '' p << 'EOF' || true
if (m/targetSdkVersion:\\s+(.*)$/) {
  print $1;
  exit;
}
EOF
needed=$(cat .config.yml | perl -ne "$p")
current=30
check_update_needed targetSdkVersion "$needed" "$current"

# minSdkVersion
read -d '' p << 'EOF' || true
if (m/minSdkVersion:\\s+(.*)$/) {
  print $1;
  exit;
}
EOF
needed=$(cat .config.yml | perl -ne "$p")
current=21
check_update_needed minSdkVersion "$needed" "$current"

# application-services
read -d '' p << 'EOF' || true
if (m/const\\sval\\smozilla_appservices\\s=\\s"([^"]+)"/) {
  print $1;
  exit;
}
EOF
needed=$(cat buildSrc/src/main/java/Dependencies.kt | perl -ne "$p")
current='[% pc("application-services", "version") %]'
check_update_needed application-services "$needed" "$current"

# glean_parser
read -d '' p << 'EOF' || true
if (m/^\\s*"glean_parser==([^"]+)",/) {
  print $1;
  exit;
}
EOF
tar xf $rootdir/[% c('input_files_by_name/glean') %]
needed=$(cat glean-[% c("var/glean_version") %]/glean-core/python/setup.py | perl -ne "$p")
current='[% c("var/glean_parser") %]'
check_update_needed glean_parser "$needed" "$current"

# gradle
read -d '' p << 'EOF' || true
if (m|distributionUrl=https\\\\://services.gradle.org/distributions/gradle-(.*)-bin.zip|) {
  print $1;
  exit;
}
EOF
needed=$(cat gradle/wrapper/gradle-wrapper.properties | perl -ne "$p")
current='[% c("var/gradle_version") %]'
check_update_needed gradle "$needed" "$current"

# android-gradle-plugin
read -d '' p << 'EOF' || true
if (m/const\\s+val\\s+android_gradle_plugin\\s+=\\s+"([^"]+)"/) {
  print $1;
  exit;
}
EOF
needed=$(cat buildSrc/src/main/java/Dependencies.kt | perl -ne "$p")
current='7.0.0'
check_update_needed android-gradle-plugin "$needed" "$current"

repo_name: JeremyRand/tor

license: mit


code:
From 563526695139d07ec8192c71c99270b0de3e33ff Mon Sep 17 00:00:00 2001
From: Georg Koppen <gk@torproject.org>
Date: Wed, 20 May 2020 14:18:12 +0000
Subject: [PATCH] mavenLocal() fixes

---
 build.gradle             | 2 ++
 buildSrc/build.gradle    | 2 ++
 buildSrc/settings.gradle | 7 ++++++-
 settings.gradle          | 7 +++++++
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/build.gradle b/build.gradle
index eb19f4a217..c86abd5559 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,6 +6,7 @@ import static org.gradle.api.tasks.testing.TestResult.ResultType

 buildscript {
     repositories {
+        mavenLocal()
         if (project.hasProperty("googleRepo")) {
             maven {
                 name "Google"
@@ -40,6 +41,7 @@ plugins {

 allprojects {
     repositories {
+        mavenLocal()
         if (project.hasProperty("googleRepo")) {
             maven {
                 name "Google"
diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index b2af6cdea2..67a25b7841 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -7,6 +7,8 @@ plugins {
 }

 repositories {
+    mavenLocal()
+
     if (project.hasProperty("centralRepo")) {
         maven {
             name "MavenCentral"
diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle
index c31ad3840d..fb6526db30 100644
--- a/buildSrc/settings.gradle
+++ b/buildSrc/settings.gradle
@@ -1,10 +1,15 @@
 /* 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/. */
+pluginManagement {
+  repositories {
+    mavenLocal()
+  }
+}

 buildCache {
     local {
         directory = new File(rootDir, '../.build-cache')
         removeUnusedEntriesAfterDays = 30
     }
-}
\ No newline at end of file
+}
diff --git a/settings.gradle b/settings.gradle
index e1204312f5..428e9ddcdf 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -4,8 +4,15 @@

 import org.yaml.snakeyaml.Yaml

+pluginManagement {
+  repositories {
+    mavenLocal()
+  }
+}
+
 buildscript {
     repositories {
+        mavenLocal()
         if (hasProperty("centralRepo")) {
             maven {
                 name "MavenCentral"


code:
#!/bin/bash
[% c("var/set_default_env") -%]
export PROJECT_PATH=/var/tmp/dist/[% project %]
export SDK_HOME=$PROJECT_PATH/android-sdk-linux
export NDK_HOME=$SDK_HOME/ndk

# Make directories
mkdir -p $NDK_HOME $SDK_HOME

# Compiler Archives
unzip -qq [% c("input_files_by_name/android_sdk_tools") %] -d $SDK_HOME
mkdir -p $SDK_HOME/cmdline-tools
unzip -qq [% c("input_files_by_name/android_commandlinetools") %] -d $SDK_HOME/cmdline-tools
mv $SDK_HOME/cmdline-tools/cmdline-tools $SDK_HOME/cmdline-tools/[% c("var/commandlinetools_version_string") %]
unzip -qq [% c("input_files_by_name/android_ndk_compiler")%] -d $NDK_HOME
ln -s $NDK_HOME/android-ndk-r[% c("var/android_ndk_version") %][% c("var/android_ndk_revision") %] $NDK_HOME/[% c("var/android_ndk_version_build") %]

# NDK Archive
# Adjust cross compilation prefix for armv7a. Unfortunately, the compiler cross
# compilation prefix and the one for all the other tools differ. Let's fix that
# so we only have to take care of one. See: #33557 (comment 2674649).
cd $NDK_HOME/android-ndk-r[% c("var/android_ndk_version") %][% c("var/android_ndk_revision") %]/toolchains/llvm/prebuilt/linux-x86_64/bin
for f in `ls arm-linux-androideabi-*`; do
  ln -s $f ${f//arm-linux-androideabi/armv7a-linux-androideabi}
done

# Tool Archives
cd $SDK_HOME
unzip -qq $HOME/[% c("input_files_by_name/build_tools") %] -d $SDK_HOME
mkdir -p build-tools/[% c("var/version_31") %]
mv [% c("var/android_release_dir") %]/* build-tools/[% c("var/version_31") %]

unzip -qq $HOME/[% c("input_files_by_name/platform") %] -d $SDK_HOME
mkdir -p platforms/android-[% c("var/android_api_level") %]
mv [% c("var/android_release_dir") %]/* platforms/android-[% c("var/android_api_level") %]

# Apart from GeckoView all other projects do still need build-tools 28.0.3 as
# they are using the Gradle plugin 3.2.1 - 3.6.0 without specifying
# `buildToolsVersion`.
unzip -qq $HOME/[% c("input_files_by_name/build_tools_28") %] -d $SDK_HOME
mkdir -p build-tools/[% c("var/version_28") %]
mv [% c("var/android_release_dir_28") %]/* build-tools/[% c("var/version_28") %]

# Application Services currently needs build tools 30.0.2
unzip -qq $HOME/[% c("input_files_by_name/build_tools_30") %] -d $SDK_HOME
mkdir -p build-tools/[% c("var/version_30") %]
mv [% c("var/android_release_dir_30") %]/* build-tools/[% c("var/version_30") %]

unzip -qq $HOME/[% c("input_files_by_name/build_tools_29") %] -d $SDK_HOME
mkdir -p build-tools/[% c("var/version_29") %]
mv [% c("var/android_release_dir_29") %]/* build-tools/[% c("var/version_29") %]

unzip -qq $HOME/[% c("input_files_by_name/platform_30") %] -d $SDK_HOME
mkdir -p platforms/android-[% c("var/android_api_level_30") %]
mv [% c("var/android_release_dir_30") %]/* platforms/android-[% c("var/android_api_level_30") %]

unzip -qq $HOME/[% c("input_files_by_name/platform_29") %] -d $SDK_HOME
mkdir -p platforms/android-[% c("var/android_api_level_29") %]
mv [% c("var/android_release_dir_29") %]/* platforms/android-[% c("var/android_api_level_29") %]

unzip -qq $HOME/[% c("input_files_by_name/platform_tools") %] -d $SDK_HOME

# That's a quirk required by GeckoView but let's have it here instead of in the
# project's build script
mkdir emulator
cp tools/emulator emulator/

# Archive dist directory
cd /var/tmp/dist
[% c('tar', {
        tar_src => [ project ],
        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
        }) %]

path: projects/android-toolchain/build


code:
# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
version: '[% c("var/version_28") %]+[% c("var/version_29") %]+[% c("var/version_30") %]+[% c("var/version_31") %]'
container:
  use_container: 1
var:
  version_31: 31.0.0
  version_30: 30.0.2
  version_29: 29.0.2
  version_28: 28.0.3
  deps:
    - unzip
    - python3
  setup: |
    mkdir -p /var/tmp/dist
    tar -C /var/tmp/dist -xf $rootdir/[% c("compiler_tarfile") %]
    export ANDROID_HOME=/var/tmp/dist/[% project %]/android-sdk-linux
    # By default we use the old NDK which is the one GeckoView is using.
    # However, we can overwrite that per project if needed (e.g.
    # application-services is currently on a newer NDK).
    export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/android-ndk-r[% c("var/android_ndk_version") %][% c("var/android_ndk_revision") %]
    export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME
    export ANDROID_NDK_API_VERSION=[% c("var/android_ndk_version") %][% c('var/android_ndk_revision') %]
    export NDK_HOST_TAG=linux-x86_64
    export GRADLE_HOME=/var/tmp/dist/[% project %]/gradle
    export GRADLE_USER_HOME=$GRADLE_HOME
    export PATH=$PATH:$ANDROID_HOME/build-tools/[% c("var/version_31") %]:$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin:$GRADLE_HOME/gradle/bin
    mkdir -p "$GRADLE_HOME"
  google_repo: https://dl.google.com/android/repository
  android_api_level: 31
  android_platform_revision: 01
  android_release_dir: android-12
  android_api_level_30: 30
  android_platform_revision_30: 03
  android_release_dir_30: android-11
  android_api_level_29: 29
  android_platform_revision_29: 04
  android_release_dir_29: android-10
  android_release_dir_28: android-9
  android_ndk_version: 21
  android_ndk_revision: d
  android_ndk_version_build: 21.3.6528147
  # XXX: In commit 83fffa1198c3cbeffec45028971896876e2133a5 mozilla
  # replaced sdk-tools with commandlinetools. We try to do the same here,
  # but it seems sdk-tools is still being used in the build, so we can't
  # remove sdk-tools yet.
  sdk_tools_version: 4333796
  commandlinetools_version: 7583922
  commandlinetools_version_string: 5.0
input_files:
  - project: container-image
  - URL: '[% c("var/google_repo") %]/build-tools_r31-linux.zip'
    name: build_tools
    sha256sum: f90c22f5562638a2e00762e1711eebd55e7f0a05232b65200d387307d057bfe8
  - URL: '[% c("var/google_repo") %]/build-tools_r[% c("var/version_30") %]-linux.zip'
    name: build_tools_30
    sha256sum: 565af786dc0cc1941002174fb945122eabd080b222cd4c7c3d9a2ae0fabf5dc4
  - URL: '[% c("var/google_repo") %]/build-tools_r[% c("var/version_29") %]-linux.zip'
    name: build_tools_29
    sha256sum: 1e9393cbfd4a4b82e30e7f55ab38db4a5a3259db93d5821c63597bc74522fa08
  - URL: '[% c("var/google_repo") %]/build-tools_r[% c("var/version_28") %]-linux.zip'
    name: build_tools_28
    sha256sum: 7954956a40633c88f693d638cbc23f68e9e2499dc7a4b7dfdaf6a3e91387749a
  - URL: '[% c("var/google_repo") %]/platform-[% c("var/android_api_level_29") %]_r[% c("var/android_platform_revision_29") %].zip'
    name: platform_29
    sha256sum: c9eaf2ce4e8fa6f5a8036bd3c95363d003733bf0a1bd349718cadf802db44c69
  - URL: '[% c("var/google_repo") %]/platform-[% c("var/android_api_level_30") %]_r[% c("var/android_platform_revision_30") %].zip'
    name: platform_30
    sha256sum: f3f5b75744dbf6ee6ed3e8174a71e513bfee502d0bc3463ea97e517bff68d84e
  - URL: '[% c("var/google_repo") %]/platform-[% c("var/android_api_level") %]_r[% c("var/android_platform_revision") %].zip'
    name: platform
    sha256sum: 1d69fe1d7f9788d82ff3a374faf4f6ccc9d1d372aa84a86b5bcfb517523b0b3f
  # ./mach bootstrap is fetching the latest version, so it does not seem to
  # matter which particular version we are using. Pin to the one fitting best to
  # SDK version/build-tools version.
  - URL: '[% c("var/google_repo") %]/platform-tools_r[% c("var/version_30") %]-linux.zip'
    name: platform_tools
    sha256sum: f7306a7c66d8149c4430aff270d6ed644c720ea29ef799dc613d3dc537485c6e
  - URL: '[% c("var/google_repo") %]/sdk-tools-linux-[% c("var/sdk_tools_version") %].zip'
    name: android_sdk_tools
    sha256sum: 92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9
  - URL: '[% c("var/google_repo") %]/commandlinetools-linux-[% c("var/commandlinetools_version") %]_latest.zip'
    name: android_commandlinetools
    sha256sum: 124f2d5115eee365df6cf3228ffbca6fc3911d16f8025bebd5b1c6e2fcfa7faf
  - URL: '[% c("var/google_repo") %]/android-ndk-r[% c("var/android_ndk_version") %][% c("var/android_ndk_revision") %]-linux-x86_64.zip'
    name: android_ndk_compiler
    sha256sum: dd6dc090b6e2580206c64bcee499bc16509a5d017c6952dcd2bed9072af67cbd

path: projects/android-toolchain/config


code:
diff --git a/components/support/nimbus-fml/src/parser.rs b/components/support/nimbus-fml/src/parser.rs
index 1de9a301..19d29373 100644
--- a/components/support/nimbus-fml/src/parser.rs
+++ b/components/support/nimbus-fml/src/parser.rs
@@ -2,7 +2,7 @@
 * 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/. */

-use std::{collections::HashMap, path::Path};
+use std::{collections::BTreeMap, collections::HashMap, path::Path};

 use serde::{Deserialize, Serialize};
 use serde_json::json;
@@ -22,7 +22,7 @@ pub(crate) struct EnumVariantBody {
 #[derive(Debug, Deserialize, Serialize, Clone)]
 pub(crate) struct EnumBody {
     description: String,
-    variants: HashMap<String, EnumVariantBody>,
+    variants: BTreeMap<String, EnumVariantBody>,
 }

 #[derive(Debug, Deserialize, Serialize, Clone)]
@@ -39,26 +39,26 @@ pub(crate) struct FieldBody {
 pub(crate) struct ObjectBody {
     description: String,
     failable: Option<bool>,
-    fields: HashMap<String, FieldBody>,
+    fields: BTreeMap<String, FieldBody>,
 }

 #[derive(Debug, Deserialize, Serialize, Clone, Default)]
 pub(crate) struct Types {
-    enums: HashMap<String, EnumBody>,
-    objects: HashMap<String, ObjectBody>,
+    enums: BTreeMap<String, EnumBody>,
+    objects: BTreeMap<String, ObjectBody>,
 }

 #[derive(Debug, Deserialize, Serialize, Clone)]
 pub(crate) struct FeatureBody {
     description: String,
-    variables: HashMap<String, FieldBody>,
+    variables: BTreeMap<String, FieldBody>,
     #[serde(alias = "defaults")]
     default: Option<serde_json::Value>,
 }
 #[derive(Debug, Deserialize, Serialize, Clone, Default)]
 pub(crate) struct ManifestFrontEnd {
     types: Types,
-    features: HashMap<String, FeatureBody>,
+    features: BTreeMap<String, FeatureBody>,
     channels: Vec<String>,
 }


code:
#!/bin/bash
[% c("var/set_default_env") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
distdir=/var/tmp/dist/[% project %]
builddir=/var/tmp/build/[% project %]
mkdir $distdir
mkdir /var/tmp/build

tar -C $GRADLE_HOME -xf $rootdir/[% c('input_files_by_name/gradle') %]
cd /var/tmp/dist
[% FOREACH arch = ['armv7', 'aarch64', 'x86', 'x86_64', 'linux-x86_64'] -%]
  tar -xf $rootdir/[% c('input_files_by_name/nss-' _ arch) %]
  mv nss nss-[% arch %]
  tar -xf $rootdir/[% c('input_files_by_name/sqlcipher-' _ arch) %]
  mv sqlcipher sqlcipher-[% arch %]
[% END -%]
tar -xf $rootdir/[% c('input_files_by_name/rust') %]
tar -xf $rootdir/[% c('input_files_by_name/uniffi-rs') %]
export PATH=/var/tmp/dist/rust/bin:/var/tmp/dist/uniffi-rs:$PATH
cd $rootdir

export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64

[% IF !c('var/fetch_gradle_dependencies') %]
  gradle_repo=$rootdir/[% c('input_files_by_name/gradle-dependencies') %]
  cp -r $gradle_repo/dl/android/maven2/* $gradle_repo
  cp -r $gradle_repo/m2/* $gradle_repo
  cp -r $gradle_repo/maven2/* $gradle_repo
[% END %]

tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz

# Prepare the offline build.
# Move the directory for hardcoding the path in .cargo/config.
mv /var/tmp/build/[% project %]-[% c('version') %] $builddir
tar -C $builddir -xjf application-services-vendor-[% c('version') %].tar.bz2
cd $builddir
# Make sure our vendored crates are used for offline builds.
cat >> .cargo/config << 'EOF'

[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "/var/tmp/build/application-services/vendor"

[net]
offline=true
EOF

# Move NSS and SQLCipher to the right place
# XXX: Maybe merge with the loop above.
archs="armv7 aarch64 x86 x86_64 linux-x86_64"
for a in $archs
do
  if [ "$a" == "armv7" ]
  then
    mkdir -p libs/android/armeabi-v7a
    mv /var/tmp/dist/nss-$a libs/android/armeabi-v7a/nss
    mv /var/tmp/dist/sqlcipher-$a libs/android/armeabi-v7a/sqlcipher
  elif [ "$a" == "aarch64" ]
  then
    mkdir -p libs/android/arm64-v8a
    mv /var/tmp/dist/nss-$a libs/android/arm64-v8a/nss
    mv /var/tmp/dist/sqlcipher-$a libs/android/arm64-v8a/sqlcipher
  elif [ "$a" == "linux-x86_64" ]
  then
    mkdir -p libs/desktop/linux-x86-64
    mv /var/tmp/dist/nss-$a libs/desktop/linux-x86-64/nss
    mv /var/tmp/dist/sqlcipher-$a libs/desktop/linux-x86-64/sqlcipher
  else
    mkdir -p libs/android/$a
    mv /var/tmp/dist/nss-$a libs/android/$a/nss
    mv /var/tmp/dist/sqlcipher-$a libs/android/$a/sqlcipher
  fi
done

patch -p1 < $rootdir/no-git.patch
patch -p1 < $rootdir/bug40485.patch
export RUST_ANDROID_GRADLE_PYTHON_COMMAND=python3
[% IF c('var/fetch_gradle_dependencies') %]
  # XXX: `assemble` is still not enough to see all fetched dependencies via
  # Gradle's --debug. See: tor-browser-build#40056.
  gradle --debug --no-daemon assemble > gradle.log 2>&1 || ( cat gradle.log; exit 1 )
  $rootdir/gen_gradle_deps_file.sh gradle.log
  mv gradle-dependencies-list.txt '[% dest_dir _ "/" _ c("filename") %]'
[% ELSE %]
  # Prepare Glean dependencies for offline build
  tar -xf $rootdir/[% c('input_files_by_name/glean-wheels') %]
  # We need to set `LC_ALL` and `LANG` to something that is not ASCII as encoding
  # otherwise `click` barfs. See: https://click.palletsprojects.com/python3/
  export LC_ALL=C.UTF-8
  export LANG=C.UTF-8
  patch -p1 < $rootdir/mavenLocal.patch
  gradle_flags="--offline --no-daemon -Dmaven.repo.local=$gradle_repo"
  gradle $gradle_flags assembleRelease
  gradle $gradle_flags publish

  pushd components/support/nimbus-fml
  cargo build --release
  popd

  pushd build
  find maven -regex '.*[0-9].\(aar\|pom\)' -exec cp --parents {} $distdir \;
  popd

  cp target/release/nimbus-fml $distdir

  cd /var/tmp/dist
  [% c('tar', {
      tar_src => [ project ],
      tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  }) %]
[% END %]

path: projects/application-services/build


code:
# 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
container:
  use_container: 1

var:
  # 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") %]'
  # Delete when this patch is included upstream
  - filename: bug40485.patch

steps:
  list_toolchain_updates:
    git_hash: 'v91.1.0'
    input_files: []
    container:
      use_container: 0
    var:
      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

path: projects/application-services/config