Class: Fastlane::Actions::IosBuildPreflightAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



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

def self.authors
  ['Automattic']
end

.available_optionsObject



51
52
53
54
55
56
57
58
59
60
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb', line 51

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :derived_data_path,
      description: "The path to the DerivedData directory for the project. Should match what's used in the `gym` action",
      type: String,
      default_value: '~/Library/Developer/Xcode/DerivedData'
    ),
  ]
end

.descriptionObject



43
44
45
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb', line 43

def self.description
  'Clean the environment to ensure a safe build'
end

.detailsObject



47
48
49
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb', line 47

def self.details
  'Clean the environment to ensure a safe build'
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb', line 72

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

.outputObject



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

def self.output
end

.return_valueObject



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

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

def self.run(params)
  # Validate mobile configuration secrets
  other_action.configure_apply

  Action.sh("cd .. && rm -rf #{params[:derived_data_path]}")

  # Verify that ImageMagick exists on this machine and can be called from the command-line.
  # Internal Builds use it to generate the App Icon as part of the build process
  begin
    Action.sh('which convert')
  rescue StandardError
    UI.user_error!("Couldn't find ImageMagick. Please install it by running `brew install imagemagick`")
    raise
  end

  # Verify that Ghostscript exists on this machine and can be called from the command-line.
  # Internal Builds use it to generate the App Icon as part of the build process
  begin
    Action.sh('which gs')
  rescue StandardError
    UI.user_error!("Couldn't find Ghostscript. Please install it by running `brew install ghostscript`")
    raise
  end

  # Check gems and pods are up to date. This will exit if it fails
  begin
    Action.sh('bundle check')
  rescue StandardError
    UI.user_error!("You should run 'rake dependencies' to make sure gems are up to date")
    raise
  end

  other_action.cocoapods
end