123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- #!/bin/bash
- # ndk version
- read -d '' p << 'EOF' || true
- if (m/^\\s*NDK_VERSION\\s*=\\s*"(.+)"/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat python/mozboot/mozboot/android.py | perl -ne "$p")
- current='r[% pc("android-toolchain", "var/android_ndk_version") %][% pc("android-toolchain", "var/android_ndk_revision") %]'
- check_update_needed ndk_version "$needed" "$current"
- # rust
- read -d '' p << 'EOF' || true
- my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/rust.yml');
- foreach my $t (keys %$d) {
- if ($d->{$t}{run}{'toolchain-alias'} eq 'linux64-rust-android') {
- my $channel;
- foreach my $arg (@{$d->{$t}{run}{arguments}}) {
- if ($arg eq '--channel') {
- $channel = 1;
- next;
- }
- if ($channel) {
- print $arg;
- exit;
- }
- }
- }
- }
- EOF
- needed=$(perl -MYAML::XS -e "$p")
- current='[% pc("rust", "version") %]'
- check_update_needed rust "$needed" "$current"
- # build_tools
- read -d '' p << 'EOF' || true
- if (m/build_tools_version\\s*=\\s*"([^"]+)"/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat build/moz.configure/android-sdk.configure | perl -ne "$p")
- current='[% pc("android-toolchain", "var/version_30") %]'
- check_update_needed build_tools "$needed" "$current"
- # target_sdk
- read -d '' p << 'EOF' || true
- if (m/target_sdk_version\\s*=\\s*"(.+)"/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat build/moz.configure/android-sdk.configure | perl -ne "$p")
- current='[% pc("android-toolchain", "var/android_api_level") %]'
- check_update_needed target_sdk "$needed" "$current"
- # sdk-tools
- read -d '' p << 'EOF' || true
- if (m|https://dl\\.google\\.com/android/repository/sdk-tools-.+-([^-]+).zip|) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat python/mozboot/mozboot/android.py | perl -ne "$p")
- current='[% pc("android-toolchain", "var/sdk_tools_version") %]'
- check_update_needed sdk-tools "$needed" "$current"
- # min-android
- read -d '' p << 'EOF' || true
- use Path::Tiny;
- use Digest::SHA qw(sha256_hex);
- my $f;
- my $min_indent;
- foreach (path('build/moz.configure/android-ndk.configure')->lines_utf8) {
- if ($_ eq "def min_android_version(target):\\n") {
- $f = $_;
- next;
- } else {
- next unless $f;
- }
- m/^(\\s*)/;
- my $indent = length $1;
- $min_indent = $indent unless $min_indent;
- last if $indent < $min_indent;
- $f .= $_;
- }
- print substr(sha256_hex($f), 0, 10);
- EOF
- needed=$(perl -e "$p")
- # We can't easily parse the min_android_version function.
- # Instead we get a checksum of the function, and manually check it when
- # it was updated.
- # Current value of min_android_version is:
- # 21 on aarch64, x86_64
- # 16 on other archs
- current=303de6de36
- check_update_needed min-android "$needed" "$current"
- # min_sdk
- read -d '' p << 'EOF' || true
- if (m/^\\s*MOZ_ANDROID_MIN_SDK_VERSION\\s*=\\s*([^\\s]+)/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat mobile/android/confvars.sh | perl -ne "$p")
- current=16
- check_update_needed min_sdk "$needed" "$current"
- # gradle
- read -d '' p << 'EOF' || true
- if (m|distributionUrl=https\\\\://services.gradle.org/distributions/gradle-(.*)-all.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"
- # cbindgen
- read -d '' p << 'EOF' || true
- if (m/^\\s*cbindgen_min_version\\s*=\\s*Version\\("([^"]+)"\\)/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat build/moz.configure/bindgen.configure | perl -ne "$p")
- current='[% pc("cbindgen", "version") %]'
- check_update_needed cbindgen "$needed" "$current"
- # nasm
- read -d '' p << 'EOF' || true
- if (m/^\\s*MODERN_NASM_VERSION\\s*=\\s*LooseVersion\\("([^"]+)"\\)/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat python/mozboot/mozboot/base.py | perl -ne "$p")
- current='2.14'
- check_update_needed nasm "$needed" "$current"
- # clang
- read -d '' p << 'EOF' || true
- my $d = YAML::XS::LoadFile('taskcluster/ci/toolchain/clang.yml');
- my $clang_toolchain;
- foreach my $t (keys %$d) {
- if ($d->{$t}{run}{'toolchain-alias'} eq 'linux64-clang-android-cross') {
- foreach my $fetch (@{$d->{$t}{fetches}{fetch}}) {
- $clang_toolchain = $fetch if $fetch =~ m/^clang-.*/;
- }
- last;
- }
- }
- if (!$clang_toolchain) {
- print STDERR "Error: could not find clang toolchain";
- exit 1;
- }
- my $fetch = YAML::XS::LoadFile('taskcluster/ci/fetch/toolchains.yml');
- print $fetch->{$clang_toolchain}{fetch}{revision};
- EOF
- needed=$(perl -MYAML::XS -e "$p")
- current='[% pc("llvm-project", "git_hash") %]'
- check_update_needed clang "$needed" "$current"
- # node
- read -d '' p << 'EOF' || true
- if (m/^\\s*NODE_MIN_VERSION\\s*=\\s*StrictVersion\\("([^"]+)"\\)/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat python/mozbuild/mozbuild/nodeutil.py | perl -ne "$p")
- current='[% pc("node", "version") %]'
- check_update_needed node "$needed" "$current"
- # python
- read -d '' p << 'EOF' || true
- if (m/find_python3_executable\\(min_version\\s*=\\s*"([^"]+)"/) {
- print $1;
- exit;
- }
- EOF
- needed=$(cat build/moz.configure/init.configure | perl -ne "$p")
- current=3.6.0
- check_update_needed python "$needed" "$current"
|