Class: XcodeProject::PBXNativeTarget

Inherits:
Node
  • Object
show all
Defined in:
lib/xcodeproject/pbx_native_target.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#isa, #uuid

Instance Method Summary collapse

Constructor Details

#initialize(root, uuid, data) ⇒ PBXNativeTarget

Returns a new instance of PBXNativeTarget.



12
13
14
15
16
17
18
19
20
# File 'lib/xcodeproject/pbx_native_target.rb', line 12

def initialize (root, uuid, data)
	super(root, uuid, data)

	@name = data['name']
	@product_name = data['productName']
	@product_reference = data['productReference']
	@product_type = data['productType']
	@dependencies = data['dependencies']
end

Instance Attribute Details

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



10
11
12
# File 'lib/xcodeproject/pbx_native_target.rb', line 10

def dependencies
  @dependencies
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/xcodeproject/pbx_native_target.rb', line 6

def name
  @name
end

#product_nameObject (readonly)

Returns the value of attribute product_name.



7
8
9
# File 'lib/xcodeproject/pbx_native_target.rb', line 7

def product_name
  @product_name
end

#product_referenceObject (readonly)

Returns the value of attribute product_reference.



8
9
10
# File 'lib/xcodeproject/pbx_native_target.rb', line 8

def product_reference
  @product_reference
end

#product_typeObject (readonly)

Returns the value of attribute product_type.



9
10
11
# File 'lib/xcodeproject/pbx_native_target.rb', line 9

def product_type
  @product_type
end

Instance Method Details

#add_source(file) ⇒ Object



26
27
28
# File 'lib/xcodeproject/pbx_native_target.rb', line 26

def add_source (file)
	sources_build_phase.add_file(file)
end

#build_configurations_listObject



42
43
44
# File 'lib/xcodeproject/pbx_native_target.rb', line 42

def build_configurations_list
	root.object!(data['buildConfigurationList'])
end

#build_phasesObject



46
47
48
# File 'lib/xcodeproject/pbx_native_target.rb', line 46

def build_phases
	data['buildPhases'].map {|uuid| root.object!(uuid) }
end

#config(name) ⇒ Object



38
39
40
# File 'lib/xcodeproject/pbx_native_target.rb', line 38

def config (name)
	build_configurations_list.build_configuration(name)
end

#configsObject



34
35
36
# File 'lib/xcodeproject/pbx_native_target.rb', line 34

def configs
	build_configurations_list.build_configurations
end

#doctorObject



66
67
68
# File 'lib/xcodeproject/pbx_native_target.rb', line 66

def doctor
	build_phases.each {|phase| phase.doctor }
end

#frameworks_build_phaseObject



62
63
64
# File 'lib/xcodeproject/pbx_native_target.rb', line 62

def frameworks_build_phase
	build_phases.select {|obj| obj.is_a?(PBXFrameworksBuildPhase) }.first
end

#headers_build_phaseObject



54
55
56
# File 'lib/xcodeproject/pbx_native_target.rb', line 54

def headers_build_phase
	build_phases.select {|obj| obj.is_a?(PBXHeadersBuildPhase) }.first
end

#remove_source(file) ⇒ Object



30
31
32
# File 'lib/xcodeproject/pbx_native_target.rb', line 30

def remove_source (file)
	sources_build_phase.remove_file(file)
end

#resources_build_phaseObject



58
59
60
# File 'lib/xcodeproject/pbx_native_target.rb', line 58

def resources_build_phase
	build_phases.select {|obj| obj.is_a?(PBXResourcesBuildPhase) }.first
end

#sourcesObject



22
23
24
# File 'lib/xcodeproject/pbx_native_target.rb', line 22

def sources
	sources_build_phase.files
end

#sources_build_phaseObject



50
51
52
# File 'lib/xcodeproject/pbx_native_target.rb', line 50

def sources_build_phase
	build_phases.select {|obj| obj.is_a?(PBXSourcesBuildPhase) }.first
end