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

[tor-commits] [tor-browser-build/maint-10.0-android] Bug 40162: Build Fenix instrumented tests apk



commit f695effd4dc3384f3e8d401929a807039ee77a63
Author: Alex Catarineu <acat@xxxxxxxxxxxxxx>
Date:   Fri Dec 11 23:13:12 2020 +0100

    Bug 40162: Build Fenix instrumented tests apk
---
 projects/fenix/build               | 9 +++++----
 projects/tor-browser/build.android | 4 ++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/projects/fenix/build b/projects/fenix/build
index f1536f1..c91dce3 100644
--- a/projects/fenix/build
+++ b/projects/fenix/build
@@ -37,8 +37,10 @@ cd $builddir-[% c("version") %]
 cp $rootdir/[% c('input_files_by_name/topl') %]/* app/
 cp $rootdir/[% c('input_files_by_name/tor-android-service') %]/* app/
 
+# XXX We need the build variant in lower case. Do something smarter here.
+v=[% c("variant") %]
 [% IF c("var/fetch_gradle_dependencies") %]
-  $GRADLE_HOME/gradle-6.5.1/bin/gradle --debug --no-daemon app:assemble[% c('variant') %] -x lint
+  $GRADLE_HOME/gradle-6.5.1/bin/gradle --debug --no-daemon app:assemble[% c('variant') %] app:assembleAndroidTest -x lint -PtestBuildType=${v,}
 [% ELSE %]
   # Add our localized strings
   [% FOREACH lang = c('var/locales_mobile');
@@ -63,10 +65,9 @@ cp $rootdir/[% c('input_files_by_name/tor-android-service') %]/* app/
   fi
 
   version_name='[% c("var/torbrowser_version") %] ([% c("var/fenix_version") %]-[% c("variant") %])'
-  $GRADLE_HOME/gradle-6.5.1/bin/gradle --offline --no-daemon -PversionName="$version_name" -Dmaven.repo.local=$gradle_repo app:assemble[% c('variant') %] -x lint
-  # XXX We need the build variant in lower case. Do something smarter here.
-  v=[% c("variant") %]
+  $GRADLE_HOME/gradle-6.5.1/bin/gradle --offline --no-daemon -PversionName="$version_name" -Dmaven.repo.local=$gradle_repo app:assemble[% c('variant') %] app:assembleAndroidTest -x lint -PtestBuildType=${v,}
   cp app/build/outputs/apk/${v,}/*.apk $distdir/[% project %]
+  cp app/build/outputs/apk/androidTest/${v,}/app-${v,}-androidTest.apk $distdir/[% project %]
 
   cd $distdir
   [% c('tar', {
diff --git a/projects/tor-browser/build.android b/projects/tor-browser/build.android
index 71b9d36..e9354bd 100644
--- a/projects/tor-browser/build.android
+++ b/projects/tor-browser/build.android
@@ -4,6 +4,8 @@ assets_dir=assets
 ext_dir=$assets_dir/extensions
 qa_apk=[% dest_dir %]/[% c('filename') %]/tor-browser-[% c("version") %]-[% c("var/osname") %]-multi-qa.apk
 apk=$rootdir/fenix/app-[% c("var/abi") %]-*.apk
+test_out_apk=[% dest_dir %]/[% c('filename') %]/tor-browser-[% c("version") %]-[% c("var/osname") %]-androidTest.apk
+test_in_apk=$rootdir/fenix/app-*-androidTest.apk
 
 tar xavf $rootdir/[% c('input_files_by_name/fenix') %]
 
@@ -32,3 +34,5 @@ mv $rootdir/allowed_addons.json $assets_dir/allowed_addons.json
 # Sign a QA build. This .apk is not a debug version and doesn't contain a debug
 # flag in the manifest.
 java -jar /usr/lib/android-sdk/build-tools/debian/apksigner.jar sign --verbose --min-sdk-version [% c("var/android_min_api") %] --ks $rootdir/android-qa.keystore --out $qa_apk --in $apk --ks-key-alias androidqakey --key-pass pass:android --ks-pass pass:android
+
+java -jar /usr/lib/android-sdk/build-tools/debian/apksigner.jar sign --verbose --min-sdk-version [% c("var/android_min_api") %] --ks $rootdir/android-qa.keystore --out $test_out_apk --in $test_in_apk  --ks-key-alias androidqakey --key-pass pass:android --ks-pass pass:android



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