Class: XCodeBuildHelper::XCode

Inherits:
Object
  • Object
show all
Defined in:
lib/xcode.rb

Instance Method Summary collapse

Constructor Details

#initializeXCode

Returns a new instance of XCode.



9
10
11
12
13
14
# File 'lib/xcode.rb', line 9

def initialize
  @device_registry = {}
  @tp_registry = {}
  @coverage_registry = {}
  @lint_registry = {}
end

Instance Method Details

#config(name) ⇒ Object



40
41
42
# File 'lib/xcode.rb', line 40

def config(name)
  @config = name
end

#coverage_plan(name, coverage_plan = nil, &block) ⇒ Object



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/xcode.rb', line 88

def coverage_plan(name, coverage_plan = nil, &block)
  if coverage_plan == nil
    if @coverage_registry[name] == nil
      coverage_plan = XCodeBuildHelper::CoveragePlan.new
    else
      coverage_plan = @coverage_registry[name]
    end
  end

  if block_given?
    coverage_plan.instance_eval(&block)
  end

  @coverage_registry[name] = coverage_plan
end

#device(name, device = nil, &block) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/xcode.rb', line 48

def device(name, device = nil, &block)
  if device == nil
    if @device_registry[name] == nil
      device = XCodeBuildHelper::Device.new
    else
      device = @device_registry[name]
    end
  end

  if block_given?
    device.instance_eval(&block)
  end

  @device_registry[name] = device
end

#get_configObject



44
45
46
# File 'lib/xcode.rb', line 44

def get_config
  @config
end

#get_coverage_plan(name) ⇒ Object



104
105
106
# File 'lib/xcode.rb', line 104

def get_coverage_plan(name)
  @coverage_registry[name]
end

#get_device(name) ⇒ Object



64
65
66
# File 'lib/xcode.rb', line 64

def get_device(name)
  @device_registry[name]
end

#get_lint_plan(name) ⇒ Object



124
125
126
# File 'lib/xcode.rb', line 124

def get_lint_plan(name)
  @lint_registry[name]
end

#get_schemeObject



28
29
30
# File 'lib/xcode.rb', line 28

def get_scheme
  @scheme
end

#get_sdkObject



36
37
38
# File 'lib/xcode.rb', line 36

def get_sdk
  @sdk
end

#get_test_plan(name) ⇒ Object



84
85
86
# File 'lib/xcode.rb', line 84

def get_test_plan(name)
  @tp_registry[name]
end

#get_workspaceObject



20
21
22
# File 'lib/xcode.rb', line 20

def get_workspace
  @workspace
end

#lint_plan(name, lint_plan = nil, &block) ⇒ Object



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/xcode.rb', line 108

def lint_plan(name, lint_plan = nil, &block)
  if lint_plan == nil
    if @lint_registry[name] == nil
      lint_plan = XCodeBuildHelper::LintPlan.new
    else
      lint_plan = @lint_registry[name]
    end
  end

  if block_given?
    lint_plan.instance_eval(&block)
  end

  @lint_registry[name] = lint_plan
end

#scheme(name) ⇒ Object



24
25
26
# File 'lib/xcode.rb', line 24

def scheme(name)
  @scheme = name
end

#sdk(name) ⇒ Object



32
33
34
# File 'lib/xcode.rb', line 32

def sdk(name)
  @sdk = name
end

#test_plan(name, test_plan = nil, &block) ⇒ Object



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/xcode.rb', line 68

def test_plan(name, test_plan = nil, &block)
  if test_plan == nil
    if @tp_registry[name] == nil
      test_plan = XCodeBuildHelper::TestPlan.new
    else
      test_plan = @tp_registry[name]
    end
  end

  if block_given?
    test_plan.instance_eval(&block)
  end

  @tp_registry[name] = test_plan
end

#workspace(name) ⇒ Object



16
17
18
# File 'lib/xcode.rb', line 16

def workspace(name)
  @workspace = name
end