diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..c81f48c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "rebornix.ruby" + ] +} \ No newline at end of file diff --git a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy.rb b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy.rb index 605d951..e4abd70 100644 --- a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy.rb +++ b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/actions/build_and_deploy.rb @@ -5,11 +5,10 @@ module Fastlane module Actions class AndroidCdAction < Action def self.run(params) - # Check parameters unless Helper::AndroidCdHelper.is_set(params[:beta_type]) UI.error("Parameters beta_type cannot be null") - puts "Error on beta type parameter" + puts("Error on beta type parameter") end UI.message("Building and deploying to Google Play Store in #{params[:beta_type]}") @@ -19,20 +18,20 @@ module Fastlane # Clean the project before building Fastlane::Actions.gradle(task: "clean") - + # Set the build number based on the number of commits - build_number = Fastlane::Actions.number_of_commits() - + build_number = Fastlane::Actions.number_of_commits + # Build the Android App Bundle Fastlane::Actions.gradle( task: "bundle", build_type: "Release", print_command: true, properties: { - "android.injected.version.code" => build_number, + "android.injected.version.code" => build_number } ) - + # Upload the Android App Bundle to the Play Store Fastlane::Actions.upload_to_play_store( track: params[:beta_type], @@ -42,7 +41,7 @@ module Fastlane skip_upload_images: true, skip_upload_screenshots: true, release_status: "draft", - version_code: build_number, + version_code: build_number ) UI.success('🍺 Successfully build & deploy appbundle to Google Play Store') @@ -68,7 +67,7 @@ module Fastlane FastlaneCore::ConfigItem.new(key: :beta_type, env_name: "ANDROID_CD_TEST_TYPE", optional: false, - description: "Type of test (production, beta, alpha, internal)"), + description: "Type of test (production, beta, alpha, internal)") ] end diff --git a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb index 8b5b256..3aa310d 100644 --- a/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb +++ b/plugins/fastlane-plugin-android_cd/lib/fastlane/plugin/android_cd/helper/android_cd_helper.rb @@ -1,10 +1,9 @@ require 'fastlane_core/ui/ui' module Fastlane - module Helper + module Helper class AndroidCdHelper def self.decrypt_android_keys(android_directory) - # Define the GPG command with options gpg_command = "gpg --quiet --batch --yes --decrypt --passphrase=#{ENV['ANDROID_KEYS_SECRET_PASSPHRASE']} \ --output #{android_directory}/android_keys.zip #{android_directory}/android_keys.zip.gpg" @@ -18,11 +17,11 @@ module Fastlane # Move the extracted files to the current directory `jar xvf #{android_directory} && mv #{android_directory}/android_keys/* #{android_directory}` else - puts "Erreur lors de la décompression du fichier GPG" + puts("Erreur lors de la décompression du fichier GPG") end end - def self.is_set variable + def self.is_set(variable) str_variable = variable str_variable = variable.strip if variable.class.to_s == "String" variable && !(str_variable.nil? || str_variable.empty?)