class Fastlane::Actions::XcversionAction

Public Class Methods

authors() click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 25
def self.authors
  ["oysta"]
end
available_options() click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 29
def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :version,
                                 env_name: "FL_XCODE_VERSION",
                                 description: "The version of Xcode to select specified as a Gem::Version requirement string (e.g. '~> 7.1.0')",
                                 optional: false,
                                 verify_block: Helper::XcversionHelper::Verify.method(:requirement))
  ]
end
category() click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 50
def self.category
  :building
end
description() click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 17
def self.description
  "Select an Xcode to use by version specifier"
end
details() click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 21
def self.details
  "Finds and selects a version of an installed Xcode that best matches the provided [`Gem::Version` requirement specifier](http://www.rubydoc.info/github/rubygems/rubygems/Gem/Version)"
end
example_code() click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 43
def self.example_code
  [
    'xcversion(version: "8.1") # Selects Xcode 8.1.0',
    'xcversion(version: "~> 8.1.0") # Selects the latest installed version from the 8.1.x set'
  ]
end
is_supported?(platform) click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 39
def self.is_supported?(platform)
  [:ios, :mac].include?(platform)
end
run(params) click to toggle source
# File fastlane/lib/fastlane/actions/xcversion.rb, line 4
def self.run(params)
  Actions.verify_gem!('xcode-install')

  version = params[:version]
  xcode = Helper::XcversionHelper.find_xcode(version)
  UI.user_error!("Cannot find an installed Xcode satisfying '#{version}'") if xcode.nil?

  UI.verbose("Found Xcode version #{xcode.version} at #{xcode.path} satisfying requirement #{version}")
  UI.message("Setting Xcode version to #{xcode.path} for all build steps")

  ENV["DEVELOPER_DIR"] = File.join(xcode.path, "/Contents/Developer")
end