Class: Xcodeproj::Project::Object::PBXProject
- Inherits:
-
AbstractObject
- Object
- AbstractObject
- Xcodeproj::Project::Object::PBXProject
- Defined in:
- lib/xcodeproj/project/object/root_object.rb
Overview
This class represents the root object of a project document.
Attributes collapse
-
#attributes ⇒ Hash{String => String}
Attributes the attributes of the target.
-
#build_configuration_list ⇒ XCConfigurationList
The configuration list of the project.
-
#compatibility_version ⇒ String
The compatibility version of the project.
-
#development_region ⇒ String
The development region of the project.
-
#has_scanned_for_encodings ⇒ String
Whether the project has scanned for encodings.
-
#known_regions ⇒ Array<String>
The list of known regions.
-
#main_group ⇒ PBXGroup
The main group of the project.
-
#product_ref_group ⇒ PBXGroup
The group containing the references to products of the project.
-
#project_dir_path ⇒ String
The directory of the project.
-
#project_references ⇒ Array<ObjectDictionary>
readonly
Any reference to other projects.
-
#project_root ⇒ String
The root of the project.
Attributes inherited from AbstractObject
Attributes collapse
- #ascii_plist_annotation ⇒ Object
- #name ⇒ Object
-
#package_references ⇒ Array<XCRemoteSwiftPackageReference>
The list of Swift package references.
-
#targets ⇒ ObjectList<AbstractTarget>
A list of all the targets in the project.
- #to_ascii_plist ⇒ Object
- #to_hash_as(method = :to_hash) ⇒ Object
Methods inherited from AbstractObject
#<=>, #==, #display_name, #inspect, isa, #nested_object_for_hash, #pretty_print, #remove_from_project, #sort, #sort_recursively, #to_hash
Instance Attribute Details
#attributes ⇒ Hash{String => String}
The hash might contain the following keys:
-
‘CLASSPREFIX`
-
‘LastUpgradeCheck`
-
‘ORGANIZATIONNAME`
Returns attributes the attributes of the target.
23 24 25 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 23 attribute :attributes, Hash, 'LastSwiftUpdateCheck' => Constants::LAST_SWIFT_UPGRADE_CHECK, 'LastUpgradeCheck' => Constants::LAST_UPGRADE_CHECK |
#build_configuration_list ⇒ XCConfigurationList
Returns the configuration list of the project.
29 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 29 has_one :build_configuration_list, XCConfigurationList |
#compatibility_version ⇒ String
Returns the compatibility version of the project.
33 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 33 attribute :compatibility_version, String, 'Xcode 3.2' |
#development_region ⇒ String
Returns the development region of the project.
37 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 37 attribute :development_region, String, 'en' |
#has_scanned_for_encodings ⇒ String
Returns whether the project has scanned for encodings.
41 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 41 attribute :has_scanned_for_encodings, String, '0' |
#known_regions ⇒ Array<String>
Returns the list of known regions.
45 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 45 attribute :known_regions, Array, %w(en Base) |
#main_group ⇒ PBXGroup
Returns the main group of the project. The one displayed by Xcode in the Project Navigator.
50 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 50 has_one :main_group, PBXGroup |
#product_ref_group ⇒ PBXGroup
Returns the group containing the references to products of the project.
55 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 55 has_one :product_ref_group, PBXGroup |
#project_dir_path ⇒ String
Returns the directory of the project.
59 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 59 attribute :project_dir_path, String, '' |
#project_references ⇒ Array<ObjectDictionary> (readonly)
Returns any reference to other projects.
71 72 73 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 71 has_many_references_by_keys :project_references, :project_ref => PBXFileReference, :product_group => PBXGroup |
#project_root ⇒ String
Returns the root of the project.
63 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 63 attribute :project_root, String, '' |
Instance Method Details
#ascii_plist_annotation ⇒ Object
79 80 81 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 79 def ascii_plist_annotation ' Project object ' end |
#name ⇒ Object
75 76 77 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 75 def name project.path.basename('.xcodeproj').to_s end |
#package_references ⇒ Array<XCRemoteSwiftPackageReference>
Returns the list of Swift package references.
67 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 67 has_many :package_references, XCRemoteSwiftPackageReference |
#targets ⇒ ObjectList<AbstractTarget>
Returns a list of all the targets in the project.
12 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 12 has_many :targets, AbstractTarget |
#to_ascii_plist ⇒ Object
91 92 93 94 95 96 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 91 def to_ascii_plist plist = super plist.value.delete('projectReferences') if plist.value['projectReferences'].empty? plist.value.delete('packageReferences') if !plist.value['packageReferences'].nil? && plist.value['packageReferences'].empty? plist end |
#to_hash_as(method = :to_hash) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 83 def to_hash_as(method = :to_hash) hash_as = super if !hash_as['packageReferences'].nil? && hash_as['packageReferences'].empty? hash_as.delete('packageReferences') if !hash_as['packageReferences'].nil? && hash_as['packageReferences'].empty? end hash_as end |