Class: Xcodeproj::Project::Object::PBXTargetDependency
- Inherits:
-
AbstractObject
- Object
- AbstractObject
- Xcodeproj::Project::Object::PBXTargetDependency
- Defined in:
- lib/xcodeproj/project/object/target_dependency.rb
Overview
Represents a dependency of a target on another one.
Attributes collapse
-
#name ⇒ String
The name of the target.
-
#platform_filter ⇒ String
The platform filter for this target dependency.
-
#platform_filters ⇒ Array<String>
The platform filters for this target dependency.
-
#product_ref ⇒ XCSwiftPackageProductDependency
The Swift Package product for this target dependency.
-
#target ⇒ PBXNativeTarget
The target that needs to be built to satisfy the dependency.
-
#target_proxy ⇒ PBXContainerItemProxy
A proxy for the target that needs to be built.
Attributes inherited from AbstractObject
AbstractObject Hooks collapse
- #ascii_plist_annotation ⇒ Object
-
#display_name ⇒ String
The name of the dependency.
-
#native_target_uuid ⇒ String
The uuid of the target if the dependency is a native target, the uuid of the target in the sub-project if the dependency is a target proxy, nil if the dependency is a Swift Package.
- #sort_recursively(_options = nil) ⇒ Object
-
#to_tree_hash ⇒ Hash<String => String>
Returns a cascade representation of the object without UUIDs.
Methods inherited from AbstractObject
#<=>, #==, #inspect, isa, #nested_object_for_hash, #pretty_print, #remove_from_project, #sort, #to_ascii_plist, #to_hash
Instance Attribute Details
#name ⇒ String
This seems only to be used when the target dependency is a target from a nested Xcode project.
Returns the name of the target.
27 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 27 attribute :name, String |
#platform_filter ⇒ String
Returns the platform filter for this target dependency.
31 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 31 attribute :platform_filter, String |
#platform_filters ⇒ Array<String>
Returns the platform filters for this target dependency.
35 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 35 attribute :platform_filters, Array |
#product_ref ⇒ XCSwiftPackageProductDependency
Returns the Swift Package product for this target dependency.
40 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 40 has_one :product_ref, XCSwiftPackageProductDependency |
#target ⇒ PBXNativeTarget
Returns the target that needs to be built to satisfy the dependency.
12 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 12 has_one :target, AbstractTarget |
#target_proxy ⇒ PBXContainerItemProxy
Apparently to support targets in other projects of the same workspace.
Returns a proxy for the target that needs to be built.
20 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 20 has_one :target_proxy, PBXContainerItemProxy |
Instance Method Details
#ascii_plist_annotation ⇒ Object
56 57 58 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 56 def ascii_plist_annotation " #{isa} " end |
#display_name ⇒ String
Returns The name of the dependency.
49 50 51 52 53 54 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 49 def display_name return name if name return target.name if target return target_proxy.remote_info if target_proxy return product_ref.product_name if product_ref end |
#native_target_uuid ⇒ String
Returns the uuid of the target if the dependency is a native target, the uuid of the target in the sub-project if the dependency is a target proxy, nil if the dependency is a Swift Package.
65 66 67 68 69 70 71 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 65 def native_target_uuid return target.uuid if target return target_proxy.remote_global_id_string if target_proxy return nil if product_ref raise "Expected target or target_proxy, from which to fetch a uuid for target '#{display_name}'." \ "Find and clear the PBXTargetDependency entry with uuid '#{@uuid}' in your .xcodeproj." end |
#sort_recursively(_options = nil) ⇒ Object
This is a no-op, because the targets could theoretically depend on each other, leading to a stack level too deep error.
92 93 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 92 def sort_recursively( = nil) end |
#to_tree_hash ⇒ Hash<String => String>
This override is necessary because Xcode allows for circular target dependencies.
Returns a cascade representation of the object without UUIDs.
79 80 81 82 83 84 85 |
# File 'lib/xcodeproj/project/object/target_dependency.rb', line 79 def to_tree_hash hash = {} hash['displayName'] = display_name hash['isa'] = isa hash['targetProxy'] = target_proxy.to_tree_hash if target_proxy hash end |