Class: Fastlane::Actions::AndroidCurrentBranchIsHotfixAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



63
64
65
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 63

def self.authors
  ['Automattic']
end

.available_optionsObject



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 35

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :build_gradle_path,
                                 description: 'Path to the build.gradle file',
                                 type: String,
                                 optional: true,
                                 conflicting_options: %i[project_name
                                                         project_root_folder
                                                         version_properties_path]),
    FastlaneCore::ConfigItem.new(key: :version_properties_path,
                                 description: 'Path to the version.properties file',
                                 type: String,
                                 optional: true,
                                 conflicting_options: %i[build_gradle_path
                                                         project_name
                                                         project_root_folder]),
    Fastlane::Helper::Deprecated.project_root_folder_config_item,
    Fastlane::Helper::Deprecated.project_name_config_item,
  ]
end

.descriptionObject



27
28
29
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 27

def self.description
  'Checks if the current branch is for a hotfix'
end

.detailsObject



31
32
33
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 31

def self.details
  'Checks if the current branch is for a hotfix'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 67

def self.is_supported?(platform)
  platform == :android
end

.outputObject



56
57
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 56

def self.output
end

.return_valueObject



59
60
61
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 59

def self.return_value
  'True if the branch is for a hotfix, false otherwise'
end

.run(params) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb', line 8

def self.run(params)
  require_relative '../../helper/android/android_version_helper'

  project_root_folder = params[:project_root_folder]
  project_name = params[:project_name]
  build_gradle_path = params[:build_gradle_path] || (File.join(project_root_folder || '.', project_name, 'build.gradle') unless project_name.nil?)
  version_properties_path = params[:version_properties_path] || File.join(project_root_folder || '.', 'version.properties')

  version = Fastlane::Helper::Android::VersionHelper.get_release_version(
    build_gradle_path: build_gradle_path,
    version_properties_path: version_properties_path
  )
  Fastlane::Helper::Android::VersionHelper.is_hotfix?(version)
end