Class: Fastlane::Actions::EnsureXcodeVersionAction
Constant Summary
Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES
Class Method Summary
collapse
action_name, author, deprecated_notes, lane_context, method_missing, other_action, return_type, sample_return_value, shell_out_should_use_bundle_exec?, step_text
Class Method Details
.authors ⇒ Object
55
56
57
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 55
def self.authors
["JaviSoto"]
end
|
.available_options ⇒ Object
36
37
38
39
40
41
42
43
44
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 36
def self.available_options
[
FastlaneCore::ConfigItem.new(key: :version,
env_name: "FL_ENSURE_XCODE_VERSION",
description: "Xcode version to verify that is selected",
is_string: true,
optional: false)
]
end
|
.category ⇒ Object
63
64
65
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 63
def self.category
:building
end
|
.description ⇒ Object
27
28
29
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 27
def self.description
"Ensure the selected Xcode version with xcode-select matches a value"
end
|
.details ⇒ Object
31
32
33
34
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 31
def self.details
"If building your app requires a specific version of Xcode, you can invoke this command before using gym.\n
For example, to ensure that a beta version of Xcode is not accidentally selected to build, which would make uploading to TestFlight fail."
end
|
.example_code ⇒ Object
59
60
61
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 59
def self.example_code
['ensure_xcode_version(version: "7.2")']
end
|
.is_supported?(platform) ⇒ Boolean
67
68
69
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 67
def self.is_supported?(platform)
[:ios, :mac].include?(platform)
end
|
.output ⇒ Object
46
47
48
49
50
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 46
def self.output
[
['FL_ENSURE_XCODE_VERSION', 'Xcode version to verify that is selected']
]
end
|
.return_value ⇒ Object
52
53
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 52
def self.return_value
end
|
.run(params) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'fastlane/lib/fastlane/actions/ensure_xcode_version.rb', line 8
def self.run(params)
Actions.verify_gem!('xcode-install')
required_version = params[:version]
selected_version = sh("xcversion selected").match(/^Xcode (.*)$/)[1]
if selected_version == required_version
UI.success("Selected Xcode version is correct: #{selected_version}")
else
UI.message("Selected Xcode version is not correct: #{selected_version}. You expected #{required_version}.")
UI.message("To correct this, use: `xcode_select(version: #{required_version})`.")
UI.user_error!("Selected Xcode version doesn't match your requirement.\nExpected: Xcode #{required_version}\nActual: #{selected_version}\n")
end
end
|