Sha256: 4ac8b731d7e60c92fe3a305da4879c14d39c90b09b5019c8cff43f9597966387

Contents?: true

Size: 1.82 KB

Versions: 454

Compression:

Stored size: 1.82 KB

Contents

module Fastlane
  module Actions
    class XcversionAction < Action
      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

      def self.description
        "Select an Xcode to use by version specifier"
      end

      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

      def self.authors
        ["oysta"]
      end

      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

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

      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

      def self.category
        :building
      end
    end
  end
end

Version data entries

454 entries across 454 versions & 1 rubygems

Version Path
fastlane-2.65.0.beta.20171111010004 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.65.0.beta.20171110010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.65.0.beta.20171109010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.65.0.beta.20171108010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.65.0.beta.20171107010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.64.0 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.64.0.beta.20171106010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.64.0.beta.20171105010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.64.0.beta.20171104010004 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.64.0.beta.20171103010004 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.64.0.beta.20171102010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.64.0.beta.20171101010004 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0.beta.20171031010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0.beta.20171030010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0.beta.20171029010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0.beta.20171028010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0.beta.20171027010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0.beta.20171026010003 fastlane/lib/fastlane/actions/xcversion.rb
fastlane-2.63.0.beta.20171025010003 fastlane/lib/fastlane/actions/xcversion.rb