Module: ZergXcode::Builder::Sdk

Defined in:
lib/zerg_xcode/builder/sdks.rb

Overview

Logic for the multiple SDKs in an Xcode installation.

Class Method Summary collapse

Class Method Details

.allObject

All the SDKs installed.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/zerg_xcode/builder/sdks.rb', line 16

def self.all
  return @all if @all
  
  output = `xcodebuild -showsdks`
  @all = []
  group = ''
  output.each_line do |line|
    if line.index '-sdk '
      name, arg = *line.split('-sdk ').map { |token| token.strip }
      @all << { :group => group, :name => name, :arg => arg }
    elsif line.index ':'
      group = line.split(':').first.strip
    end
  end
  @all
end