Class: XcodeProject::PBXProject

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

Instance Attribute Summary collapse

Attributes inherited from Node

#isa, #uuid

Instance Method Summary collapse

Constructor Details

#initialize(root, uuid, data) ⇒ PBXProject

Returns a new instance of PBXProject.



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/xcodeproject/pbx_project.rb', line 37

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

  @main_group = root.object!(data['mainGroup'])
  @product_ref_group = root.object!(data['productRefGroup'])
  @project_dir_path = data['projectDirPath']
  @compatibility_version = data['compatibilityVersion']
  @development_region = data['developmentRegion']
  @know_regions = data['knownRegions']
  @attributes = data['attributes']
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



35
36
37
# File 'lib/xcodeproject/pbx_project.rb', line 35

def attributes
  @attributes
end

#compatibility_versionObject (readonly)

Returns the value of attribute compatibility_version.



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

def compatibility_version
  @compatibility_version
end

#development_regionObject (readonly)

Returns the value of attribute development_region.



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

def development_region
  @development_region
end

#know_regionsObject (readonly)

Returns the value of attribute know_regions.



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

def know_regions
  @know_regions
end

#main_groupObject (readonly)

Returns the value of attribute main_group.



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

def main_group
  @main_group
end

#product_ref_groupObject (readonly)

Returns the value of attribute product_ref_group.



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

def product_ref_group
  @product_ref_group
end

#project_dir_pathObject (readonly)

Returns the value of attribute project_dir_path.



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

def project_dir_path
  @project_dir_path
end

Instance Method Details

#target(name) ⇒ Object



53
54
55
# File 'lib/xcodeproject/pbx_project.rb', line 53

def target (name)
  root.find_object('PBXNativeTarget', {'name' => name})
end

#targetsObject



49
50
51
# File 'lib/xcodeproject/pbx_project.rb', line 49

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