Class: Pod::Target
- Inherits:
-
Object
- Object
- Pod::Target
- Defined in:
- lib/cocoapods/target.rb
Overview
Model class which describes a Pods target.
The Target class stores and provides the information necessary for working with a target in the Podfile and it’s dependent libraries. This class is used to represent both the targets and their libraries.
Direct Known Subclasses
Information storage collapse
-
#archs ⇒ String
The value for the ARCHS build setting.
-
#target ⇒ PBXNativeTarget
The target generated in the Pods project for this library.
-
#user_build_configurations ⇒ Hash{String=>Symbol}
A hash representing the user build configurations where each key corresponds to the name of a configuration and its value to its type (
:debugor:release).
Instance Attribute Summary collapse
-
#sandbox ⇒ Sandbox
readonly
The sandbox where the Pods should be installed.
-
#target_definition ⇒ PBXNativeTarget
readonly
The target definition of the Podfile that generated this target.
Information storage collapse
-
#platform ⇒ Platform
The platform for this library.
Support files collapse
-
#bridge_support_path ⇒ Pathname
The absolute path of the bridge support file.
-
#dummy_source_path ⇒ Pathname
The path of the dummy source generated by CocoaPods.
-
#prefix_header_path ⇒ Pathname
The absolute path of the prefix header file.
-
#support_files_dir ⇒ Pathname
The folder where to store the support files of this library.
-
#target_environment_header_path ⇒ Pathname
The absolute path of the header file which contains the information about the installed pods.
-
#xcconfig_path(variant = nil) ⇒ Pathname
The absolute path of the xcconfig file.
-
#xcconfig_private_path ⇒ Pathname
The absolute path of the private xcconfig file.
Instance Method Summary collapse
-
#inspect ⇒ String
A string suitable for debugging.
-
#name ⇒ String
The name of the library.
-
#product_name ⇒ String
The name of the library.
-
#xcconfig_prefix ⇒ String
The XCConfig namespaced prefix.
Instance Attribute Details
#archs ⇒ String
Returns The value for the ARCHS build setting.
65 66 67 |
# File 'lib/cocoapods/target.rb', line 65 def archs @archs end |
#sandbox ⇒ Sandbox (readonly)
Returns The sandbox where the Pods should be installed.
16 17 18 |
# File 'lib/cocoapods/target.rb', line 16 def sandbox @sandbox end |
#target ⇒ PBXNativeTarget
Returns the target generated in the Pods project for this library.
55 56 57 |
# File 'lib/cocoapods/target.rb', line 55 def target @target end |
#target_definition ⇒ PBXNativeTarget (readonly)
Returns the target definition of the Podfile that generated this target.
12 13 14 |
# File 'lib/cocoapods/target.rb', line 12 def target_definition @target_definition end |
#user_build_configurations ⇒ Hash{String=>Symbol}
Returns A hash representing the user build configurations where each key corresponds to the name of a configuration and its value to its type (:debug or :release).
50 51 52 |
# File 'lib/cocoapods/target.rb', line 50 def user_build_configurations @user_build_configurations end |
Instance Method Details
#bridge_support_path ⇒ Pathname
Returns the absolute path of the bridge support file.
114 115 116 |
# File 'lib/cocoapods/target.rb', line 114 def bridge_support_path support_files_dir + "#{label}.bridgesupport" end |
#dummy_source_path ⇒ Pathname
Returns the path of the dummy source generated by CocoaPods.
120 121 122 |
# File 'lib/cocoapods/target.rb', line 120 def dummy_source_path support_files_dir + "#{label}-dummy.m" end |
#inspect ⇒ String
Returns A string suitable for debugging.
38 39 40 |
# File 'lib/cocoapods/target.rb', line 38 def inspect "<#{self.class} name=#{name} >" end |
#name ⇒ String
Returns the name of the library.
20 21 22 |
# File 'lib/cocoapods/target.rb', line 20 def name label end |
#platform ⇒ Platform
Returns the platform for this library.
59 60 61 |
# File 'lib/cocoapods/target.rb', line 59 def platform @platform ||= target_definition.platform end |
#prefix_header_path ⇒ Pathname
Returns the absolute path of the prefix header file.
108 109 110 |
# File 'lib/cocoapods/target.rb', line 108 def prefix_header_path support_files_dir + "#{label}-prefix.pch" end |
#product_name ⇒ String
Returns the name of the library.
26 27 28 |
# File 'lib/cocoapods/target.rb', line 26 def product_name "lib#{label}.a" end |
#support_files_dir ⇒ Pathname
Returns the folder where to store the support files of this library.
74 75 76 |
# File 'lib/cocoapods/target.rb', line 74 def support_files_dir sandbox.target_support_files_dir(name) end |
#target_environment_header_path ⇒ Pathname
Returns the absolute path of the header file which contains the information about the installed pods.
101 102 103 104 |
# File 'lib/cocoapods/target.rb', line 101 def target_environment_header_path name = target_definition.label sandbox.target_support_files_dir(name) + "#{name}-environment.h" end |
#xcconfig_path(variant = nil) ⇒ Pathname
Returns the absolute path of the xcconfig file.
84 85 86 87 88 89 90 |
# File 'lib/cocoapods/target.rb', line 84 def xcconfig_path(variant = nil) if variant support_files_dir + "#{label}.#{variant.downcase}.xcconfig" else support_files_dir + "#{label}.xcconfig" end end |
#xcconfig_prefix ⇒ String
Returns the XCConfig namespaced prefix.
32 33 34 |
# File 'lib/cocoapods/target.rb', line 32 def xcconfig_prefix label.upcase.gsub(/[^A-Z]/, '_') + '_' end |
#xcconfig_private_path ⇒ Pathname
Returns the absolute path of the private xcconfig file.
94 95 96 |
# File 'lib/cocoapods/target.rb', line 94 def xcconfig_private_path support_files_dir + "#{label}-Private.xcconfig" end |