Class: Pod::Target::NonLibrary
- Inherits:
-
Object
- Object
- Pod::Target::NonLibrary
- Defined in:
- lib/cocoapods-spm/def/target.rb
Instance Attribute Summary collapse
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
-
#underlying ⇒ Object
readonly
Returns the value of attribute underlying.
Instance Method Summary collapse
-
#initialize(underlying: nil, spec: nil) ⇒ NonLibrary
constructor
A new instance of NonLibrary.
- #name ⇒ Object
- #platform ⇒ Object
- #xcconfig_path(variant) ⇒ Object
Constructor Details
#initialize(underlying: nil, spec: nil) ⇒ NonLibrary
Returns a new instance of NonLibrary.
6 7 8 9 |
# File 'lib/cocoapods-spm/def/target.rb', line 6 def initialize(underlying: nil, spec: nil) = @spec = spec end |
Instance Attribute Details
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
4 5 6 |
# File 'lib/cocoapods-spm/def/target.rb', line 4 def spec @spec end |
#underlying ⇒ Object (readonly)
Returns the value of attribute underlying.
4 5 6 |
# File 'lib/cocoapods-spm/def/target.rb', line 4 def end |
Instance Method Details
#name ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/cocoapods-spm/def/target.rb', line 11 def name if .is_a?(Xcodeproj::Project::Object::PBXNativeTarget) && .test_target_type? return .name.sub(/-(Unit|UI)-/, "/") end spec.name end |
#platform ⇒ Object
19 20 21 |
# File 'lib/cocoapods-spm/def/target.rb', line 19 def platform .platform end |
#xcconfig_path(variant) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/cocoapods-spm/def/target.rb', line 23 def xcconfig_path(variant) # For test spec, return the path as <TargetName>.unit-test.<Config>.xcconfig # Here, we're trying to get `unit-tests` out of the spec, then calling # `underlying.xcconfig_path("unit-tests.debug")` to get the result variant_prefix = .spec_label(spec).sub("#{underlying.name}-", "") .xcconfig_path("#{variant_prefix}.#{variant}") end |