Class: Pod::Library
- Inherits:
-
Object
- Object
- Pod::Library
- Defined in:
- lib/cocoapods/library.rb
Overview
Model class which describes a Pods library.
The Library class stores and provides the information necessary for working with a library in the Pods project and in the user projects through the installation process.
Information storage collapse
-
#client_root ⇒ Pathname
The folder where the client is stored used for computing the relative paths.
-
#file_accessors ⇒ Array<Sandbox::FileAccessor>
The file accessors for the specifications of this library.
-
#platform ⇒ Platform
The platform for this library.
-
#specs ⇒ Array<Specification>
The specifications of this library.
-
#support_files_root ⇒ Pathname
The folder where to store the support files of this library.
-
#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 (‘:debug` or `:release`).
-
#user_project_path ⇒ Pathname
The path of the user project that this library will integrate as identified by the analyzer.
-
#user_target_uuids ⇒ String
The list of the UUIDs of the user targets that will be integrated by this library as identified by the analizer.
-
#xcconfig ⇒ Xcodeproj::Config
The configuration file of the library.
Instance Attribute Summary collapse
-
#target_definition ⇒ PBXNativeTarget
readonly
The target definition of the Podfile that generated this library.
Support files collapse
-
#acknowledgements_basepath ⇒ Pathname
The absolute path of acknowledgements file.
-
#bridge_support_path ⇒ Pathname
The absolute path of the bridge support file.
-
#copy_resources_script_path ⇒ Pathname
The absolute path of the copy resources script.
-
#copy_resources_script_relative_path ⇒ String
The path of the copy resources script relative to the root of the user project.
-
#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.
-
#relative_pods_root ⇒ String
The xcconfig path of the root from the ‘$(SRCROOT)` variable of the user’s project.
-
#target_environment_header_path ⇒ Pathname
The absolute path of the header file which contains the information about the installed pods.
-
#xcconfig_path ⇒ Pathname
The absolute path of the xcconfig file.
-
#xcconfig_relative_path ⇒ String
The path of the xcconfig file relative to the root of the user project.
Instance Method Summary collapse
-
#initialize(target_definition) ⇒ Library
constructor
A new instance of Library.
-
#inspect ⇒ String
A string suitable for debugging.
-
#label ⇒ String
The label for the library.
-
#name ⇒ String
The name of the library.
-
#product_name ⇒ String
The name of the library.
Constructor Details
#initialize(target_definition) ⇒ Library
Returns a new instance of Library.
19 20 21 |
# File 'lib/cocoapods/library.rb', line 19 def initialize(target_definition) @target_definition = target_definition end |
Instance Attribute Details
#client_root ⇒ Pathname
Returns the folder where the client is stored used for computing the relative paths. If integrating it should be the folder where the user project is stored, otherwise it should be the installation root.
61 62 63 |
# File 'lib/cocoapods/library.rb', line 61 def client_root @client_root end |
#file_accessors ⇒ Array<Sandbox::FileAccessor>
Returns the file accessors for the specifications of this library.
109 110 111 |
# File 'lib/cocoapods/library.rb', line 109 def file_accessors @file_accessors end |
#platform ⇒ Platform
Returns the platform for this library.
87 88 89 |
# File 'lib/cocoapods/library.rb', line 87 def platform @platform end |
#specs ⇒ Array<Specification>
Returns the specifications of this library.
104 105 106 |
# File 'lib/cocoapods/library.rb', line 104 def specs @specs end |
#support_files_root ⇒ Pathname
Returns the folder where to store the support files of this library.
54 55 56 |
# File 'lib/cocoapods/library.rb', line 54 def support_files_root @support_files_root end |
#target ⇒ PBXNativeTarget
Returns the target generated in the Pods project for this library.
92 93 94 |
# File 'lib/cocoapods/library.rb', line 92 def target @target end |
#target_definition ⇒ PBXNativeTarget (readonly)
Returns the target definition of the Podfile that generated this library.
14 15 16 |
# File 'lib/cocoapods/library.rb', line 14 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`).
83 84 85 |
# File 'lib/cocoapods/library.rb', line 83 def user_build_configurations @user_build_configurations end |
#user_project_path ⇒ Pathname
The project instance is not stored to prevent editing different instances.
Returns the path of the user project that this library will integrate as identified by the analyzer.
69 70 71 |
# File 'lib/cocoapods/library.rb', line 69 def user_project_path @user_project_path end |
#user_target_uuids ⇒ String
The target instances are not stored to prevent editing different instances.
Returns the list of the UUIDs of the user targets that will be integrated by this library as identified by the analizer.
77 78 79 |
# File 'lib/cocoapods/library.rb', line 77 def user_target_uuids @user_target_uuids end |
#xcconfig ⇒ Xcodeproj::Config
The configuration is generated by the TargetInstaller and used by UserProjectIntegrator to check for any overridden values.
Returns the configuration file of the library.
100 101 102 |
# File 'lib/cocoapods/library.rb', line 100 def xcconfig @xcconfig end |
Instance Method Details
#acknowledgements_basepath ⇒ Pathname
The acknowledgements generators add the extension according to the file type.
Returns the absolute path of acknowledgements file.
151 152 153 |
# File 'lib/cocoapods/library.rb', line 151 def acknowledgements_basepath support_files_root + "#{label}-acknowledgements" end |
#bridge_support_path ⇒ Pathname
Returns the absolute path of the bridge support file.
142 143 144 |
# File 'lib/cocoapods/library.rb', line 142 def bridge_support_path support_files_root + "#{label}.bridgesupport" end |
#copy_resources_script_path ⇒ Pathname
Returns the absolute path of the copy resources script.
123 124 125 |
# File 'lib/cocoapods/library.rb', line 123 def copy_resources_script_path support_files_root + "#{label}-resources.sh" end |
#copy_resources_script_relative_path ⇒ String
Returns the path of the copy resources script relative to the root of the user project.
180 181 182 |
# File 'lib/cocoapods/library.rb', line 180 def copy_resources_script_relative_path "${SRCROOT}/#{relative_to_srcroot(copy_resources_script_path)}" end |
#dummy_source_path ⇒ Pathname
Returns the path of the dummy source generated by CocoaPods.
157 158 159 |
# File 'lib/cocoapods/library.rb', line 157 def dummy_source_path support_files_root + "#{label}-dummy.m" end |
#inspect ⇒ String
Returns A string suitable for debugging.
43 44 45 |
# File 'lib/cocoapods/library.rb', line 43 def inspect "<#{self.class} name=#{name} platform=#{platform}>" end |
#label ⇒ String
Returns the label for the library.
25 26 27 |
# File 'lib/cocoapods/library.rb', line 25 def label target_definition.label.to_s end |
#name ⇒ String
Returns the name of the library.
31 32 33 |
# File 'lib/cocoapods/library.rb', line 31 def name target_definition.label.to_s end |
#prefix_header_path ⇒ Pathname
Returns the absolute path of the prefix header file.
136 137 138 |
# File 'lib/cocoapods/library.rb', line 136 def prefix_header_path support_files_root + "#{label}-prefix.pch" end |
#product_name ⇒ String
Returns the name of the library.
37 38 39 |
# File 'lib/cocoapods/library.rb', line 37 def product_name "lib#{target_definition.label}.a" end |
#relative_pods_root ⇒ String
Returns The xcconfig path of the root from the ‘$(SRCROOT)` variable of the user’s project.
166 167 168 |
# File 'lib/cocoapods/library.rb', line 166 def relative_pods_root "${SRCROOT}/#{support_files_root.relative_path_from(client_root)}" end |
#target_environment_header_path ⇒ Pathname
Returns the absolute path of the header file which contains the information about the installed pods.
130 131 132 |
# File 'lib/cocoapods/library.rb', line 130 def target_environment_header_path support_files_root + "#{label}-environment.h" end |
#xcconfig_path ⇒ Pathname
Returns the absolute path of the xcconfig file.
117 118 119 |
# File 'lib/cocoapods/library.rb', line 117 def xcconfig_path support_files_root + "#{label}.xcconfig" end |
#xcconfig_relative_path ⇒ String
Returns the path of the xcconfig file relative to the root of the user project.
173 174 175 |
# File 'lib/cocoapods/library.rb', line 173 def xcconfig_relative_path relative_to_srcroot(xcconfig_path).to_s end |