Class: Fastlane::Actions::IosGetBuildVersionAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



50
51
52
53
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 50

def self.authors
  # So no one will ever forget your contribution to fastlane :) You are awesome btw!
  ['Automattic']
end

.available_optionsObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 29

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :internal,
      env_name: 'FL_IOS_BUILD_VERSION_INTERNAL',
      description: 'If true, returns the internal build version, otherwise returns the public one',
      is_string: false, # Boolean
      default_value: false
    ),
  ]
end

.descriptionObject



21
22
23
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 21

def self.description
  'Gets the build version of the app'
end

.detailsObject



25
26
27
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 25

def self.details
  'Gets the build version (`VERSION_LONG`) of the app from the xcconfig file'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 55

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

.outputObject



41
42
43
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 41

def self.output
  # Define the shared values you are going to provide
end

.return_valueObject



45
46
47
48
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 45

def self.return_value
  # If you method provides a return value, you can describe here what it does
  'Return the public or internal build version of the app'
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb', line 4

def self.run(params)
  require_relative '../../helper/ios/ios_version_helper'

  UI.user_error!('You need to set at least the PUBLIC_CONFIG_FILE env var to the path to the public xcconfig file') unless ENV['PUBLIC_CONFIG_FILE']

  if params[:internal]
    UI.user_error!('You need to set the INTERNAL_CONFIG_FILE env var to the path to the internal xcconfig file') unless ENV['INTERNAL_CONFIG_FILE']
    Fastlane::Helper::Ios::VersionHelper.get_internal_version
  else
    Fastlane::Helper::Ios::VersionHelper.get_build_version
  end
end