Class: Fastlane::Actions::AndroidGetVersionCodeAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AndroidGetVersionCodeAction
- Defined in:
- lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .example_code ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
54 55 56 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 54 def self. ["Igor Lamoš"] end |
.available_options ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 30 def self. [ FastlaneCore::ConfigItem.new(key: :gradle_file, env_name: "FL_ANDROID_GET_VERSION_CODE_GRADLE_FILE", description: "(optional) Specify the path to your app build.gradle if it isn't in the default location", optional: true, type: String, default_value: "app/build.gradle", verify_block: proc do |value| UI.user_error!("Could not find app build.gradle file") unless File.exist?(value) || Helper.test? end) ] end |
.description ⇒ Object
22 23 24 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 22 def self.description "Get the Version Code of your Android project" end |
.details ⇒ Object
26 27 28 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 26 def self.details "This action will return current Version Code of your Android project." end |
.example_code ⇒ Object
62 63 64 65 66 67 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 62 def self.example_code [ 'version_code = android_get_version_code # build.gradle is in the default location', 'version_code = android_get_version_code(gradle_file: "/path/to/build.gradle")' ] end |
.is_supported?(platform) ⇒ Boolean
58 59 60 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 58 def self.is_supported?(platform) [:android].include?(platform) end |
.output ⇒ Object
44 45 46 47 48 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 44 def self.output [ ['ANDROID_VERSION_CODE', 'The Version Code of your Android project'] ] end |
.return_value ⇒ Object
50 51 52 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 50 def self.return_value "The Version Code of your Android project" end |
.run(params) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/fastlane/plugin/versioning_android/actions/android_get_version_code.rb', line 8 def self.run(params) gradle_file_path = Helper::VersioningAndroidHelper.get_gradle_file_path(params[:gradle_file]) version_code = Helper::VersioningAndroidHelper.read_key_from_gradle_file(gradle_file_path, "versionCode") if version_code == false UI.user_error!("Unable to find the versionCode in build.gradle file at #{gradle_file_path}.") end UI.success("👍 Current Android Version Code is: #{version_code}") # Store the Version Code in the shared hash Actions.lane_context[SharedValues::ANDROID_VERSION_CODE] = version_code end |