Class: FruityBuilder::IOS::XCodeBuild
Constant Summary
Constants inherited
from Execution
Execution::COMMAND_RETRIES, Execution::COMMAND_TIMEOUT
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Execution
execute, execute_with_timeout_and_retry
Constructor Details
Returns a new instance of XCodeBuild.
9
10
11
|
# File 'lib/fruity_builder/xcodebuild.rb', line 9
def initialize(path)
@path = path
end
|
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
7
8
9
|
# File 'lib/fruity_builder/xcodebuild.rb', line 7
def path
@path
end
|
Class Method Details
.get_build_configurations(project_path) ⇒ Object
39
40
41
|
# File 'lib/fruity_builder/xcodebuild.rb', line 39
def self.get_build_configurations(project_path)
retrieve_project_section(get_project_info(project_path), 'Build Configurations:')
end
|
.get_project_info(project_path) ⇒ Object
47
48
49
50
51
|
# File 'lib/fruity_builder/xcodebuild.rb', line 47
def self.get_project_info(project_path)
info = execute("xcodebuild -project #{project_path} -list")
raise XCodeBuildCommandError.new(info.stderr) if info.exit != 0
info.stdout.split("\n").map { |a| a.strip }
end
|
.get_schemes(project_path) ⇒ Object
35
36
37
|
# File 'lib/fruity_builder/xcodebuild.rb', line 35
def self.get_schemes(project_path)
retrieve_project_section(get_project_info(project_path), 'Schemes:')
end
|
.get_targets(project_path) ⇒ Object
43
44
45
|
# File 'lib/fruity_builder/xcodebuild.rb', line 43
def self.get_targets(project_path)
retrieve_project_section(get_project_info(project_path), 'Targets:')
end
|
.retrieve_project_section(project_info, section) ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'lib/fruity_builder/xcodebuild.rb', line 25
def self.retrieve_project_section(project_info, section)
index = project_info.index(section)
section_values = []
for i in index+1..project_info.count - 1
break if project_info[i].empty?
section_values << project_info[i]
end
section_values
end
|
Instance Method Details
#get_build_configurations ⇒ Object
21
22
23
|
# File 'lib/fruity_builder/xcodebuild.rb', line 21
def get_build_configurations
self.class.get_build_configurations(path)
end
|
#get_schemes ⇒ Object
13
14
15
|
# File 'lib/fruity_builder/xcodebuild.rb', line 13
def get_schemes
self.class.get_schemes(path)
end
|
#get_targets ⇒ Object
17
18
19
|
# File 'lib/fruity_builder/xcodebuild.rb', line 17
def get_targets
self.class.get_targets(path)
end
|