[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-build/master] Bug 40156: Move android-components Gradle to Gradle project



commit e5997de565917852d589cd735769c488f72c489c
Author: Georg Koppen <gk@xxxxxxxxxxxxxx>
Date:   Fri Nov 27 20:27:19 2020 +0000

    Bug 40156: Move android-components Gradle to Gradle project
---
 projects/android-components/build  | 13 ++++++++-----
 projects/android-components/config |  6 ++----
 projects/gradle/config             |  7 +++++--
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/projects/android-components/build b/projects/android-components/build
index bbd7c00..187750f 100644
--- a/projects/android-components/build
+++ b/projects/android-components/build
@@ -3,10 +3,14 @@
 [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
 distdir=/var/tmp/dist
 builddir=/var/tmp/build/[% project %]
-gradle_path=$GRADLE_HOME/gradle-[% c("var/gradle_version") %]/bin
 mkdir $distdir/[% project %]
 mkdir /var/tmp/build
 
+tar -C $GRADLE_HOME -xf $rootdir/[% c('input_files_by_name/gradle') %]
+# XXX: Not needed once we are done with moving Gradle out of our toolchain
+# project.
+export PATH=$GRADLE_HOME/gradle/bin:$PATH
+
 cat > get-moz-build-date << "EOF"
 [% INCLUDE "get-moz-build-date" %]
 EOF
@@ -27,7 +31,6 @@ EOF
   # according to the Gradle dependencies list.
   cp -rf $distdir/application-services/maven/org $gradle_repo
 [% END %]
-unzip -d $GRADLE_HOME [% c('input_files_by_name/gradle') %]
 tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
 
 cd $builddir-[% c('version') %]
@@ -36,7 +39,7 @@ patch -p1 < $rootdir/git.patch
   # XXX: fetching deps for `assembleGeckoBeta -x lint` by using that same target
   # results in some missing dependencies for yet unknown reasons. Thus, we use
   # `assemble` instead for now.
-  $gradle_path/gradle --debug --no-daemon assemble
+  gradle --debug --no-daemon assemble
 [% ELSE %]
   # Prepare Glean dependencies for offline build
   tar -xjf $rootdir/glean-parser-[% c('var/glean_parser') %].tar.bz2
@@ -70,8 +73,8 @@ patch -p1 < $rootdir/git.patch
   cd ../../
   gradle_args="--offline --no-daemon -Dmaven.repo.local=$gradle_repo"
 
-  $gradle_path/gradle $gradle_args assembleGecko[% c('variant') %] -x lint
-  $gradle_path/gradle $gradle_args publish
+  gradle $gradle_args assembleGecko[% c('variant') %] -x lint
+  gradle $gradle_args publish
 
   # We only need the archives and .pom files for now.
   find components -regex '.*[% c('var/android_components_version') %].\(aar\|jar\|pom\)' -exec cp --parents {} $distdir \;
diff --git a/projects/android-components/config b/projects/android-components/config
index 4d94db0..2dfca8c 100644
--- a/projects/android-components/config
+++ b/projects/android-components/config
@@ -16,7 +16,6 @@ var:
   gradle_dependencies_version: 9
   # Switch to make it easier to grab all dependencies during a dry-run.
   fetch_gradle_dependencies: 0
-  gradle_version: 6.6.1
 
 targets:
   nightly:
@@ -27,6 +26,8 @@ input_files:
   - project: container-image
   - name: '[% c("var/compiler") %]'
     project: '[% c("var/compiler") %]'
+  - project: gradle
+    name: gradle
   - name: geckoview
     project: geckoview
     pkg_type: merge_aars
@@ -47,6 +48,3 @@ input_files:
   - URL: https://people.torproject.org/~gk/mirrors/sources/glean-parser-[% c('var/glean_parser') %].tar.bz2
     sha256sum: bdbb421fdcc9b66aebe8f41b33e254cab722355c59c0f43f10a8322d7d6da6a4
     enable: '[% !c("var/fetch_gradle_dependencies") %]'
-  - URL: https://services.gradle.org/distributions/gradle-[% c("var/gradle_version") %]-bin.zip
-    name: gradle
-    sha256sum: 7873ed5287f47ca03549ab8dcb6dc877ac7f0e3d7b1eb12685161d10080910ac
diff --git a/projects/gradle/config b/projects/gradle/config
index fe995fb..4414436 100644
--- a/projects/gradle/config
+++ b/projects/gradle/config
@@ -6,10 +6,13 @@ var:
     use_container: 1
   deps:
     - unzip
-  gradle_version: 6.5
+  # XXX: Think about ways to make this more legible, in particular once more
+  # Gradle versions get added.
+  gradle_version: '[% IF pc(c("origin_project"), "var/application_services") %]6.5[% ELSE %]6.6.1[% END %]'
+  gradle_sha256sum: '[% IF pc(c("origin_project"), "var/application_services") %]23e7d37e9bb4f8dabb8a3ea7fdee9dd0428b9b1a71d298aefd65b11dccea220f[% ELSE %]7873ed5287f47ca03549ab8dcb6dc877ac7f0e3d7b1eb12685161d10080910ac[% END %]'
 
 input_files:
   - project: container-image
   - URL: https://services.gradle.org/distributions/gradle-[% c("var/gradle_version") %]-bin.zip
     name: gradle
-    sha256sum: 23e7d37e9bb4f8dabb8a3ea7fdee9dd0428b9b1a71d298aefd65b11dccea220f
+    sha256sum: '[% c("var/gradle_sha256sum") %]'



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits