Class: Fastlane::Actions::EnsureXcodeBuildVersionAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::EnsureXcodeBuildVersionAction
- Defined in:
- lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
27 28 29 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 27 def self. ["Fumiya Nakamura"] end |
.available_options ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 31 def self. [ FastlaneCore::ConfigItem.new(key: :build_version, env_name: "FL_ENSURE_XCODE_BUILD_VERSION", description: "Xcode Build version to verify that is selected", is_string: true, optional: false) ] end |
.description ⇒ Object
18 19 20 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 18 def self.description "Ensure the selected Xcode Build version with xcode-select matches a value" end |
.details ⇒ Object
22 23 24 25 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 22 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 is not accidentally selected to build, which would make uploading to TestFlight fail." end |
.is_supported?(platform) ⇒ Boolean
50 51 52 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 50 def self.is_supported?(platform) [:ios, :mac].include?(platform) end |
.output ⇒ Object
41 42 43 44 45 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 41 def self.output [ ['FL_ENSURE_XCODE_BUILD_VERSION', 'Xcode Build version to verify that is selected'] ] end |
.return_value ⇒ Object
47 48 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 47 def self.return_value end |
.run(params) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/fastlane/plugin/ensure_xcode_build_version/actions/ensure_xcode_build_version_action.rb', line 4 def self.run(params) required_build_version = params[:build_version] selected_build_version = sh("xcodebuild -version").match(/Build version (.*)$/)[1] if selected_build_version == required_build_version UI.success("Selected Xcode Build version is correct: #{selected_build_version}") else UI.("Selected Xcode Build version is not correct: #{selected_build_version}. You expected #{required_build_version}.") UI.("To correct this, use: `xcode_select(version: #{required_build_version})`.") UI.user_error!("Selected Xcode Build version doesn't match your requirement.\nExpected: Build version #{required_build_version}\nActual: #{selected_build_version}\n") end end |