Class: Fastlane::Actions::AndroidBumpVersionBetaAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::AndroidBumpVersionBetaAction
- Defined in:
- lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
81 82 83 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 81 def self. ['Automattic'] end |
.available_options ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 60 def self. [ FastlaneCore::ConfigItem.new(key: :build_gradle_path, description: 'Path to the build.gradle file', type: String, optional: true, conflicting_options: [:version_properties_path]), FastlaneCore::ConfigItem.new(key: :version_properties_path, description: 'Path to the version.properties file', type: String, optional: true, conflicting_options: [:build_gradle_path]), ] end |
.description ⇒ Object
52 53 54 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 52 def self.description 'Bumps the version of the app for a new beta.' end |
.details ⇒ Object
56 57 58 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 56 def self.details 'Bumps the version of the app for a new beta.' end |
.is_supported?(platform) ⇒ Boolean
85 86 87 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 85 def self.is_supported?(platform) platform == :android end |
.output ⇒ Object
75 76 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 75 def self.output end |
.return_value ⇒ Object
78 79 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 78 def self.return_value end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb', line 4 def self.run(params) UI. 'Bumping app release version...' require_relative '../../helper/android/android_git_helper' require_relative '../../helper/android/android_version_helper' # Verify that the current branch is a release branch. Notice that `ensure_git_branch` expects a RegEx parameter ensure_git_branch(branch: '^release/') build_gradle_path = params[:build_gradle_path] version_properties_path = params[:version_properties_path] current_version = Fastlane::Helper::Android::VersionHelper.get_release_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) new_version_beta = Fastlane::Helper::Android::VersionHelper.calc_next_beta_version(current_version, current_version_alpha) new_version_alpha = current_version_alpha.nil? ? nil : Fastlane::Helper::Android::VersionHelper.calc_next_alpha_version(new_version_beta, current_version_alpha) vname = Fastlane::Helper::Android::VersionHelper::VERSION_NAME vcode = Fastlane::Helper::Android::VersionHelper::VERSION_CODE UI.("Current version: #{current_version[vname]}(#{current_version[vcode]})") UI.("Current alpha version: #{current_version_alpha[vname]}(#{current_version_alpha[vcode]})") unless current_version_alpha.nil? UI.("New beta version: #{new_version_beta[vname]}(#{new_version_beta[vcode]})") UI.("New alpha version: #{new_version_alpha[vname]}(#{new_version_alpha[vcode]})") unless current_version_alpha.nil? UI. 'Updating app version...' Fastlane::Helper::Android::VersionHelper.update_versions( new_version_beta, new_version_alpha, version_properties_path: version_properties_path ) UI. 'Done!' Fastlane::Helper::Android::GitHelper.commit_version_bump( build_gradle_path: build_gradle_path, version_properties_path: version_properties_path ) end |