morgan pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: 613f597e by Pier Angelo Vendrame at 2024-08-14T17:04:05+02:00 Bug 41123: Drop the firefox-android project.
While we already migrated the APKs creation in GeckoView, we still had the old firefox-android project lying around, but we do not need it anymore.
- - - - - 096681b3 by Pier Angelo Vendrame at 2024-08-14T17:11:48+02:00 Bug 41210: Use tor-expert-bundle-aar in GeckoView.
We had already migrated most of the firefox-android project to GeckoView, except for the part in which we copied tor-expert-bundle.aar to the correct directory.
Now that our Android patchset is ready, we should do it, otherwise the builds fail.
- - - - -
7 changed files:
- − projects/firefox-android/build - − projects/firefox-android/config - − projects/firefox-android/gradle-dependencies-list.txt - − projects/firefox-android/list_toolchain_updates_checks - − projects/firefox-android/repos.diff - projects/geckoview/build_apk - projects/geckoview/config
Changes:
===================================== projects/firefox-android/build deleted ===================================== @@ -1,125 +0,0 @@ -#!/bin/bash -[% c("var/set_default_env") -%] -[% pc(c('var/compiler'), 'var/setup', { - compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')), - gradle_tarfile => c("input_files_by_name/gradle"), - }) %] -distdir=/var/tmp/dist -builddir=/var/tmp/build/[% project %] -mkdir $distdir/[% project %] -mkdir /var/tmp/build - -[% c("var/set_MOZ_BUILD_DATE") %] - -# TODO: Something to fetch the gradle dependencies, automatically? - -gradle_repo=$distdir/gradle-dependencies -mv $rootdir/[% c('input_files_by_name/gradle-dependencies') %] $gradle_repo -cp -rl $gradle_repo/dl/android/maven2/* $gradle_repo || true -cp -rl $gradle_repo/m2/* $gradle_repo || true -cp -rl $gradle_repo/maven2/* $gradle_repo || true - -tar -C $distdir -xf [% c('input_files_by_name/geckoview') %] -cp -r $distdir/geckoview/* $gradle_repo -tar -C $distdir -xf [% c('input_files_by_name/application-services') %] -cp -rf $distdir/application-services/maven/* $gradle_repo -tar -C $distdir -xf $rootdir/[% c('input_files_by_name/translation-fenix') %] - -mkdir bin -cat > bin/git << 'EOF' -#!/bin/bash -# Used to include the commit hash in the build -if [ "$1" = "rev-parse" ]; then - echo "[% c('abbrev') %]" - exit 0 -fi - -# If there are uncommitted files (checked with `git status --porcelain=v2`), the -# build system will append a `+` to the commit hash. So, report a clean tree. -if [ "$1" = "status" ]; then - exit 0 -fi - -# Try to catch any other calls by making them fail -echo "fake-git: not implemented command $1" -exit 1 -EOF -chmod +x bin/git -export PATH=$rootdir/bin:$PATH - -tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.[% c('compress_tar') %] -cd $builddir-[% c('version') %] - -patch -p1 < $rootdir/repos.diff -sed -i 's|^(val VERSION = ).*|\1"[% c("var/as_version") %]"|' android-components/plugins/dependencies/src/main/java/ApplicationServices.kt -sed -i 's|^(val CHANNEL = ).*|\1ApplicationServicesChannel.RELEASE|' android-components/plugins/dependencies/src/main/java/ApplicationServices.kt -[% IF c("var/channel") == "release" -%] - gv_dir="$distdir/geckoview/org/mozilla/geckoview/geckoview-omni" -[% ELSE -%] - gv_dir="$distdir/geckoview/org/mozilla/geckoview/geckoview-[% c('var/variant') FILTER lower %]-omni" -[% END -%] -gv_version=$(find "$gv_dir" -mindepth 1 -maxdepth 1 -type d -printf '%f\n') -sed -i "s|(\s*const val version = ).*|\1"$gv_version"|" android-components/plugins/dependencies/src/main/java/Gecko.kt -sed -i 's|(\s*val channel = ).*|\1GeckoChannel.[% c("var/variant") FILTER upper %]|' android-components/plugins/dependencies/src/main/java/Gecko.kt - -export LC_ALL=C.UTF-8 -export LANG=C.UTF-8 - -# Increase the maximum memory usage, for when compiling GeckoView with -# --disable-install-strip -gradle_args="--offline --no-daemon -Dorg.gradle.jvmargs=-Xmx8g -PcentralRepo=file://$gradle_repo" -as_version="[% c('var/as_version') %]" - -# Build AC -pushd android-components - -tar -xf $rootdir/[% c('input_files_by_name/glean') %] -# Force the installation of the wheels now, otherwise the build could fail in -# environments with a lot of cores. -# See taskcluster/scripts/toolchain/external-gradle-dependencies.sh. -gradle $gradle_args support-sync-telemetry:assemble - -mkdir -p "build/bin/nimbus/$as_version" -cp $distdir/application-services/nimbus-fml "build/bin/nimbus/$as_version" - -gradle $gradle_args assembleGecko -x lint -gradle $gradle_args publish -popd - -# Build Fenix - -pushd fenix - -# Use the Android Components we have just built -echo autoPublish.android-components.dir=../android-components > local.properties - -# Add our localized strings -supported_locales="[% tmpl(c('var/locales_mobile').join(' ')) %]" -for lang in $supported_locales; do - cp "/var/tmp/dist/translation-fenix/$lang/torbrowser_strings.xml" "app/src/main/res/values-$lang/" -done - -# Move Tor Android libraries -cp $rootdir/[% c('input_files_by_name/teb') %]/tor-expert-bundle.aar app/ - -mkdir -p "build/bin/nimbus/$as_version" -cp $distdir/application-services/nimbus-fml "build/bin/nimbus/$as_version" - -# Bug 40485: Inject deterministic build date into Glean. -echo 'ext.gleanBuildDate = "0"' >> app/build.gradle - -variant='[% c("var/variant") %]' -# We put the tor-browser version last to avoid int-parsing errors when consumers of project.versionName -# assume it starts with a major version number, as it does for all Mozilla version names. -version_name="[% c('var/fenix_version') %]-${variant,} ([% c('var/torbrowser_version') %])" - -gradle $gradle_args -PversionName="$version_name" "assemble$variant" -cp app/build/outputs/apk/fenix/${variant,}/*.apk $distdir/[% project %] - -popd - -cd $distdir -[% c('tar', { - tar_src => [ project ], - tar_args => '-caf ' _ dest_dir _ '/' _ c('filename'), - }) %]
===================================== projects/firefox-android/config deleted ===================================== @@ -1,73 +0,0 @@ -# vim: filetype=yaml sw=2 -version: '[% c("abbrev") %]' -filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]' -git_hash: '[% project %]-[% c("var/fenix_version") %]-[% c("var/browser_branch") %]-build[% c("var/browser_build") %]' -git_url: https://gitlab.torproject.org/tpo/applications/firefox-android.git -tag_gpg_id: 1 -gpg_keyring: - - boklm.gpg - - dan_b.gpg - - ma1.gpg - - pierov.gpg - - morgan.gpg -container: - use_container: 1 - -var: - fenix_version: 115.2.1 - browser_branch: 13.5-1 - browser_build: 11 - variant: Beta - # This should be updated when the list of gradle dependencies is changed. - gradle_dependencies_version: 1 - gradle_version: 7.6.1 - glean_parser: 7.1.0 - as_version: '[% pc("application-services", "version") %]' - -targets: - release: - var: - variant: Release - nightly: - git_hash: '[% project %]-[% c("var/fenix_version") %]-[% c("var/browser_branch") %]' - tag_gpg_id: 0 - var: - variant: Nightly - -steps: - list_toolchain_updates: - git_url: https://github.com/mozilla-mobile/firefox-android - git_hash: releases_v115 - 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 - - name: application-services - project: application-services - - name: geckoview - project: geckoview - enable: '[% c("var/android_single_arch") %]' - - name: geckoview - project: geckoview - pkg_type: merge_aars - enable: '[% !c("var/android_single_arch") %]' - - URL: '[% pc("glean", "var/glean_wheels_url/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]' - name: glean - sha256sum: '[% pc("glean", "var/glean_wheels_sha256sum/" _ c("var/glean_parser"), { error_if_undef => 1 }) %]' - enable: '[% !c("var/fetch_gradle_dependencies") %]' - - name: translation-fenix - project: translation - pkg_type: fenix - - project: tor-expert-bundle-aar - name: teb - - filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]' - name: gradle-dependencies - exec: '[% INCLUDE "fetch-gradle-dependencies" %]' - - filename: repos.diff
===================================== projects/firefox-android/gradle-dependencies-list.txt deleted ===================================== The diff for this file was not included because it is too large.
===================================== projects/firefox-android/list_toolchain_updates_checks deleted ===================================== @@ -1,110 +0,0 @@ -#!/bin/bash - -########################## -### android-components ### -########################## - -cd android-components - -# compileSdkVersion -read -d '' p << 'EOF' || true -if (m/compileSdkVersion:\s+(.*)$/) { - print $1; - exit; -} -EOF -needed=$(cat .config.yml | perl -ne "$p") -current=33 -check_update_needed 'compileSdkVersion [android-components]' "$needed" "$current" - - -# targetSdkVersion -read -d '' p << 'EOF' || true -if (m/targetSdkVersion:\s+(.*)$/) { - print $1; - exit; -} -EOF -needed=$(cat .config.yml | perl -ne "$p") -current=33 -check_update_needed 'targetSdkVersion [android-components]' "$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 [android-components]' "$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 [android-components]' "$needed" "$current" - -cd .. - - -############# -### fenix ### -############# - -cd fenix - -# targetSdkVersion -read -d '' p << 'EOF' || true -if (m/const\s+val\s+targetSdkVersion\s+=\s+([^"]+)/) { - print $1; - exit; -} -EOF -needed=$(cat buildSrc/src/main/java/Config.kt | perl -ne "$p") -current=33 -check_update_needed 'targetSdkVersion [fenix]' "$needed" "$current" - - -# compileSdkVersion -read -d '' p << 'EOF' || true -if (m/const\s+val\s+compileSdkVersion\s+=\s+([^"]+)/) { - print $1; - exit; -} -EOF -needed=$(cat buildSrc/src/main/java/Config.kt | perl -ne "$p") -current=33 -check_update_needed 'compileSdkVersion [fenix]' "$needed" "$current" - - -# minSdkVersion -read -d '' p << 'EOF' || true -if (m/const\s+val\s+minSdkVersion\s+=\s+([^"]+)/) { - print $1; - exit; -} -EOF -needed=$(cat buildSrc/src/main/java/Config.kt | perl -ne "$p") -current=21 -check_update_needed 'minSdkVersion [fenix]' "$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 [fenix]' "$needed" "$current"
===================================== projects/firefox-android/repos.diff deleted ===================================== @@ -1,182 +0,0 @@ -diff -rup firefox-android-orig/android-components/buildSrc/settings.gradle firefox-android-0aa48c23b715/android-components/buildSrc/settings.gradle ---- firefox-android-orig/android-components/buildSrc/settings.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/android-components/buildSrc/settings.gradle 2023-07-17 09:10:40.767368326 +0000 -@@ -2,9 +2,22 @@ - * 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 { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } -+} -+ -+ - buildCache { - local { - directory = new File(rootDir, '../.build-cache') - removeUnusedEntriesAfterDays = 30 - } --} -\ No newline at end of file -+} -diff -rup firefox-android-orig/android-components/plugins/dependencies/settings.gradle firefox-android-0aa48c23b715/android-components/plugins/dependencies/settings.gradle ---- firefox-android-orig/android-components/plugins/dependencies/settings.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/android-components/plugins/dependencies/settings.gradle 2023-07-17 08:52:28.390014297 +0000 -@@ -3,3 +3,15 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - // Prevents gradle builds from looking for a root settings.gradle -+ -+pluginManagement { -+ repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } -+} -diff -rup firefox-android-orig/android-components/plugins/publicsuffixlist/settings.gradle firefox-android-0aa48c23b715/android-components/plugins/publicsuffixlist/settings.gradle ---- firefox-android-orig/android-components/plugins/publicsuffixlist/settings.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/android-components/plugins/publicsuffixlist/settings.gradle 2023-07-17 09:12:26.821491020 +0000 -@@ -3,3 +3,15 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - // Prevents gradle builds from looking for a root settings.gradle -+ -+pluginManagement { -+ repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } -+} -diff -rup firefox-android-orig/android-components/settings.gradle firefox-android-0aa48c23b715/android-components/settings.gradle ---- firefox-android-orig/android-components/settings.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/android-components/settings.gradle 2023-07-17 08:52:04.766877399 +0000 -@@ -3,6 +3,15 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - pluginManagement { -+ repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } - includeBuild("plugins/dependencies") - includeBuild("plugins/publicsuffixlist") - } -diff -rup firefox-android-orig/fenix/app/build.gradle firefox-android-0aa48c23b715/fenix/app/build.gradle ---- firefox-android-orig/fenix/app/build.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/fenix/app/build.gradle 2023-07-17 11:04:32.924432356 +0000 -@@ -898,3 +898,4 @@ android.applicationVariants.all { varian - - // Enable expiration by major version. - ext.gleanExpireByVersion = Config.majorVersion() -+ext.gleanBuildDate = "0" -diff -rup firefox-android-orig/fenix/buildSrc/build.gradle firefox-android-0aa48c23b715/fenix/buildSrc/build.gradle ---- firefox-android-orig/fenix/buildSrc/build.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/fenix/buildSrc/build.gradle 2023-07-17 12:27:28.609768018 +0000 -@@ -7,6 +7,15 @@ plugins { - } - - repositories { -+ repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } - if (project.hasProperty("centralRepo")) { - maven { - name "MavenCentral" -diff -rup firefox-android-orig/fenix/settings.gradle firefox-android-0aa48c23b715/fenix/settings.gradle ---- firefox-android-orig/fenix/settings.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/fenix/settings.gradle 2023-07-17 12:26:10.479390296 +0000 -@@ -5,6 +5,15 @@ - pluginManagement { - includeBuild("../android-components/plugins/publicsuffixlist") - includeBuild("../android-components/plugins/dependencies") -+ repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } - } - - plugins { -diff -rup firefox-android-orig/focus-android/settings.gradle firefox-android-0aa48c23b715/focus-android/settings.gradle ---- firefox-android-orig/focus-android/settings.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/focus-android/settings.gradle 2023-07-17 11:12:19.090555632 +0000 -@@ -3,6 +3,15 @@ - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - pluginManagement { -+ repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } - includeBuild("../android-components/plugins/publicsuffixlist") - includeBuild("../android-components/plugins/dependencies") - } -diff -rup firefox-android-orig/shared-settings.gradle firefox-android-0aa48c23b715/shared-settings.gradle ---- firefox-android-orig/shared-settings.gradle 2023-07-14 01:36:01.000000000 +0000 -+++ firefox-android-0aa48c23b715/shared-settings.gradle 2023-07-17 09:09:39.331186584 +0000 -@@ -6,6 +6,13 @@ import org.yaml.snakeyaml.Yaml - - buildscript { - repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } - mavenCentral() - } - -diff -upN firefox-android-orig/fenix/buildSrc/settings.gradle firefox-android-0aa48c23b715/fenix/buildSrc/settings.gradle ---- firefox-android-orig/fenix/buildSrc/settings.gradle 1970-01-01 00:00:00.000000000 +0000 -+++ firefox-android-0aa48c23b715/fenix/buildSrc/settings.gradle 2023-07-17 12:27:39.371197488 +0000 -@@ -0,0 +1,11 @@ -+pluginManagement { -+ repositories { -+ maven { -+ url "file:///var/tmp/dist/gradle-dependencies" -+ metadataSources { -+ gradleMetadata() -+ mavenPom() -+ } -+ } -+ } -+}
===================================== projects/geckoview/build_apk ===================================== @@ -98,6 +98,8 @@ rm -rf /var/tmp/dist/android-toolchain/gradle/glean/pythonenv
pushd mobile/android/fenix
+cp -a $rootdir/[% c('input_files_by_name/tor-expert-bundle-aar') %]/tor-expert-bundle.aar app/ + # Use the Android Components we have just built echo autoPublish.android-components.dir=../android-components > local.properties
===================================== projects/geckoview/config ===================================== @@ -105,6 +105,9 @@ steps: - 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
list_toolchain_updates: git_hash: tor-browser-128.0b1-14.0-1
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/compare/0...
tbb-commits@lists.torproject.org