Class: Fastlane::Actions::IosBuildPrechecksAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



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

def self.authors
  ['Automattic']
end

.available_optionsObject



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

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :skip_confirm,
                                 env_name: 'FL_IOS_BUILD_PRECHECKS_SKIP_CONFIRM',
                                 description: 'True to avoid the system ask for confirmation',
                                 type: Boolean,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :internal,
                                 env_name: 'FL_IOS_BUILD_PRECHECKS_INTERNAL_BUILD',
                                 description: 'True if this is for an internal build',
                                 type: Boolean,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :external,
                                 env_name: 'FL_IOS_BUILD_PRECHECKS_EXTERNAL_BUILD',
                                 description: 'True if this is for a public build',
                                 type: Boolean,
                                 default_value: false),
    FastlaneCore::ConfigItem.new(key: :internal_on_single_version,
                                 env_name: 'FL_IOS_BUILD_PRECHECKS_INTERNAL_SV_BUILD',
                                 description: 'True if this is for an internal build that follows the same versioning of the external',
                                 type: Boolean,
                                 default_value: false),
  ]
end

.descriptionObject



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

def self.description
  'Runs some prechecks before the build'
end

.detailsObject



30
31
32
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb', line 30

def self.details
  'Runs some prechecks before the build'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb', line 69

def self.is_supported?(platform)
  i[ios mac].include?(platform)
end

.outputObject



59
60
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb', line 59

def self.output
end

.return_valueObject



62
63
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb', line 62

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

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

  message = ''
  message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_internal_version} and uploading to App Center\n" if params[:internal]
  message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version} and uploading to App Center\n" if params[:internal_on_single_version]
  message << "Building version #{Fastlane::Helper::Ios::VersionHelper.get_build_version} and uploading to TestFlight\n" if params[:external]

  if params[:skip_confirm]
    UI.message(message)
  else
    UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
  end

  # Check local repo status
  other_action.ensure_git_status_clean unless other_action.is_ci
end