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.
-
#minimized_project_reference_proxies ⇒ Object
@return [String] whether minimizes project reference proxies.
-
#preferred_project_object_version ⇒ Object
@return [String] preferred project object version.
-
#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, XCLocalSwiftPackageReference>
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 |
#minimized_project_reference_proxies ⇒ Object
@return [String] whether minimizes project reference proxies
54 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 54 attribute :minimized_project_reference_proxies, String, '0' |
#preferred_project_object_version ⇒ Object
@return [String] preferred project object version
58 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 58 attribute :preferred_project_object_version, String, Constants::LAST_KNOWN_OBJECT_VERSION.to_s |
#product_ref_group ⇒ PBXGroup
Returns the group containing the references to products of the project.
63 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 63 has_one :product_ref_group, PBXGroup |
#project_dir_path ⇒ String
Returns the directory of the project.
67 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 67 attribute :project_dir_path, String, '' |
#project_references ⇒ Array<ObjectDictionary> (readonly)
Returns any reference to other projects.
79 80 81 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 79 has_many_references_by_keys :project_references, :project_ref => PBXFileReference, :product_group => PBXGroup |
#project_root ⇒ String
Returns the root of the project.
71 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 71 attribute :project_root, String, '' |
Instance Method Details
#ascii_plist_annotation ⇒ Object
87 88 89 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 87 def ascii_plist_annotation ' Project object ' end |
#name ⇒ Object
83 84 85 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 83 def name project.path.basename('.xcodeproj').to_s end |
#package_references ⇒ Array<XCRemoteSwiftPackageReference, XCLocalSwiftPackageReference>
Returns the list of Swift package references.
75 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 75 has_many :package_references, [XCRemoteSwiftPackageReference, XCLocalSwiftPackageReference] |
#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
99 100 101 102 103 104 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 99 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
91 92 93 94 95 96 97 |
# File 'lib/xcodeproj/project/object/root_object.rb', line 91 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 |