[Android] Fastlane: add a version option for the screenshot lane

Nicolas Pomepuy git at videolan.org
Tue Aug 10 05:47:08 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Aug  9 09:20:13 2021 +0200| [2476e2ffd4496daf32865ad3ed5fc90836ca81b0] | committer: Nicolas Pomepuy

Fastlane: add a version option for the screenshot lane

> https://code.videolan.org/videolan/vlc-android/commit/2476e2ffd4496daf32865ad3ed5fc90836ca81b0
---

 buildsystem/automation/README.md         |  2 ++
 buildsystem/automation/fastlane/Fastfile | 16 ++++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/buildsystem/automation/README.md b/buildsystem/automation/README.md
index 89880472f..7eafeddb2 100644
--- a/buildsystem/automation/README.md
+++ b/buildsystem/automation/README.md
@@ -91,6 +91,8 @@ You should also skip the welcome screens and let the scanning occur.
 
 - `screenshots`, `screenshots_seven`, `screenshots_ten`, `screenshots_tv` lanes launch respectively the screenshot UI tests for mobile, 7" tablets, 10" tablets and TV  
 
+Options: `version` is the version string in the apk name.
+
 Before running, the app and the test apks will be generated automatically
 
 #### Upload the screenshots
diff --git a/buildsystem/automation/fastlane/Fastfile b/buildsystem/automation/fastlane/Fastfile
index ef5ebf17b..9c4977b04 100644
--- a/buildsystem/automation/fastlane/Fastfile
+++ b/buildsystem/automation/fastlane/Fastfile
@@ -88,28 +88,28 @@ platform :android do
     slack(message: 'Successfully created a new internal draft for '+options[:version])
   end
 
-  lane :screenshots do
+  lane :screenshots do |options|
     gradle(task: 'assemble', build_type: 'Debug', project_dir:'../..')
     gradle(task: ':application:app:assemble', build_type: 'DebugAndroidTest', project_dir:'../..')
-    capture_android_screenshots(app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-3.3.0-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
+    capture_android_screenshots(app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-"+options[:version]+"-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
   end
 
-  lane :screenshots_seven do
+  lane :screenshots_seven do |options|
     gradle(task: 'assemble', build_type: 'Debug', project_dir:'../..')
     gradle(task: ':application:app:assemble', build_type: 'DebugAndroidTest', project_dir:'../..')
-    capture_android_screenshots(device_type:"sevenInch" ,app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-3.3.0-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
+    capture_android_screenshots(device_type:"sevenInch" ,app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-"+options[:version]+"-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
   end
 
-  lane :screenshots_ten do
+  lane :screenshots_ten do |options|
     gradle(task: 'assemble', build_type: 'Debug', project_dir:'../..')
     gradle(task: ':application:app:assemble', build_type: 'DebugAndroidTest', project_dir:'../..')
-    capture_android_screenshots(device_type:"tenInch" ,app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-3.3.0-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
+    capture_android_screenshots(device_type:"tenInch" ,app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-"+options[:version]+"-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
   end
 
-  lane :screenshots_tv do
+  lane :screenshots_tv do |options|
     gradle(task: 'assemble', build_type: 'Debug', project_dir:'../..')
     gradle(task: ':application:app:assemble', build_type: 'DebugAndroidTest', project_dir:'../..')
-    capture_android_screenshots(device_type:"tv",use_tests_in_classes:'org.videolan.vlc.TvScreenhotsInstrumentedTest', app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-3.3.0-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
+    capture_android_screenshots(device_type:"tv",use_tests_in_classes:'org.videolan.vlc.TvScreenhotsInstrumentedTest', app_apk_path:"../../application/app/build/outputs/apk/debug/VLC-Android-"+options[:version]+"-debug-all.apk", tests_apk_path:"../../application/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk")
   end
 
   lane :huawei_info do



More information about the Android mailing list