Class: Fastlane::Actions::AndroidTagBuildAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



61
62
63
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb', line 61

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
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb', line 35

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :tag_alpha,
                                 env_name: 'FL_ANDROID_TAG_BUILD_ALPHA',
                                 description: 'True to skip tagging the alpha version',
                                 type: Boolean,
                                 default_value: true),
    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

.descriptionObject



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

def self.description
  'Tags the current build'
end

.detailsObject



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

def self.details
  'Tags the current build'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb', line 65

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

.outputObject



55
56
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb', line 55

def self.output
end

.return_valueObject



58
59
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb', line 58

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
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb', line 4

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

  build_gradle_path = params[:build_gradle_path]
  version_properties_path = params[:version_properties_path]

  release_ver = Fastlane::Helper::Android::VersionHelper.get_release_version(
    build_gradle_path: build_gradle_path,
    version_properties_path: version_properties_path
  )
  alpha_ver = Fastlane::Helper::Android::VersionHelper.get_alpha_version(
    build_gradle_path: build_gradle_path,
    version_properties_path: version_properties_path
  )
  Fastlane::Helper::GitHelper.create_tag(release_ver[Fastlane::Helper::Android::VersionHelper::VERSION_NAME])
  Fastlane::Helper::GitHelper.create_tag(alpha_ver[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]) unless alpha_ver.nil? || (params[:tag_alpha] == false)
end