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.



34
35
36
37
38
39
40
41
42
# File 'lib/xcodeproject/pbx_native_target.rb', line 34

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.



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

def dependencies
  @dependencies
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#product_nameObject (readonly)

Returns the value of attribute product_name.



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

def product_name
  @product_name
end

#product_referenceObject (readonly)

Returns the value of attribute product_reference.



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

def product_reference
  @product_reference
end

#product_typeObject (readonly)

Returns the value of attribute product_type.



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

def product_type
  @product_type
end

Instance Method Details

#add_source(file) ⇒ Object



48
49
50
# File 'lib/xcodeproject/pbx_native_target.rb', line 48

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

#build_configurations_listObject



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

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

#build_phasesObject



68
69
70
# File 'lib/xcodeproject/pbx_native_target.rb', line 68

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

#config(name) ⇒ Object



60
61
62
# File 'lib/xcodeproject/pbx_native_target.rb', line 60

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

#configsObject



56
57
58
# File 'lib/xcodeproject/pbx_native_target.rb', line 56

def configs
	build_configurations_list.build_configurations
end

#doctorObject



88
89
90
# File 'lib/xcodeproject/pbx_native_target.rb', line 88

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

#frameworks_build_phaseObject



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

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

#headers_build_phaseObject



76
77
78
# File 'lib/xcodeproject/pbx_native_target.rb', line 76

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

#remove_source(file) ⇒ Object



52
53
54
# File 'lib/xcodeproject/pbx_native_target.rb', line 52

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

#resources_build_phaseObject



80
81
82
# File 'lib/xcodeproject/pbx_native_target.rb', line 80

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

#sourcesObject



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

def sources
	sources_build_phase.files
end

#sources_build_phaseObject



72
73
74
# File 'lib/xcodeproject/pbx_native_target.rb', line 72

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