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.



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

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.



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

def dependencies
  @dependencies
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#product_nameObject (readonly)

Returns the value of attribute product_name.



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

def product_name
  @product_name
end

#product_referenceObject (readonly)

Returns the value of attribute product_reference.



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

def product_reference
  @product_reference
end

#product_typeObject (readonly)

Returns the value of attribute product_type.



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

def product_type
  @product_type
end

Instance Method Details

#add_source(file) ⇒ Object



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

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

#build_configurations_listObject



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

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

#build_phasesObject



70
71
72
# File 'lib/xcodeproject/pbx_native_target.rb', line 70

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

#config(name) ⇒ Object



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

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

#configsObject



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

def configs
  build_configurations_list.build_configurations
end

#doctorObject



90
91
92
# File 'lib/xcodeproject/pbx_native_target.rb', line 90

def doctor
  build_phases.each(&:doctor)
end

#frameworks_build_phaseObject



86
87
88
# File 'lib/xcodeproject/pbx_native_target.rb', line 86

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

#headers_build_phaseObject



78
79
80
# File 'lib/xcodeproject/pbx_native_target.rb', line 78

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

#remove_source(file) ⇒ Object



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

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

#resources_build_phaseObject



82
83
84
# File 'lib/xcodeproject/pbx_native_target.rb', line 82

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

#sourcesObject



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

def sources
  sources_build_phase.files
end

#sources_build_phaseObject



74
75
76
# File 'lib/xcodeproject/pbx_native_target.rb', line 74

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