Sha256: 5e5c66cf5caa3f620cbca55c9afd1cc7b27b8cd520ae81486ede6d78cc206031

Contents?: true

Size: 1.02 KB

Versions: 449

Compression:

Stored size: 1.02 KB

Contents

module Snapshot
  class LatestOsVersion
    def self.ios_version
      return ENV["SNAPSHOT_IOS_VERSION"] if FastlaneCore::Env.truthy?("SNAPSHOT_IOS_VERSION")
      self.version("iOS")
    end

    @versions = {}
    def self.version(os)
      @versions[os] ||= version_for_os(os)
    end

    def self.version_for_os(os)
      # We do all this, because we would get all kind of crap output generated by xcodebuild
      # so we need to ignore stderror
      output = ''
      Open3.popen3('xcodebuild -version -sdk') do |stdin, stdout, stderr, wait_thr|
        output = stdout.read
      end

      matched = output.match(/#{os} ([\d\.]+) \(.*/)
      if matched.nil?
        UI.user_error!("Could not determine installed #{os} SDK version. Try running the _xcodebuild_ command manually to ensure it works.")
      elsif matched.length > 1
        return matched[1]
      else
        UI.user_error!("Could not determine installed #{os} SDK version. Please pass it via the environment variable 'SNAPSHOT_IOS_VERSION'")
      end
    end
  end
end

Version data entries

449 entries across 449 versions & 1 rubygems

Version Path
fastlane-2.65.0.beta.20171107010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.64.0 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.64.0.beta.20171106010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.64.0.beta.20171105010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.64.0.beta.20171104010004 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.64.0.beta.20171103010004 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.64.0.beta.20171102010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.64.0.beta.20171101010004 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171031010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171030010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171029010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171028010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171027010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171026010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171025010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171024010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.62.1 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171023010003 snapshot/lib/snapshot/latest_os_version.rb
fastlane-2.63.0.beta.20171022010003 snapshot/lib/snapshot/latest_os_version.rb