Class: Pod::Library

Inherits:
Object
  • Object
show all
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

Instance Attribute Summary collapse

Support files collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_definition) ⇒ Library

Returns a new instance of Library.

Parameters:

  • target_definition (TargetDefinition)

    @see target_definition

  • target (PBXNativeTarget)

    @see target



19
20
21
# File 'lib/cocoapods/library.rb', line 19

def initialize(target_definition)
  @target_definition = target_definition
end

Instance Attribute Details

#client_rootPathname

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.

Returns:

  • (Pathname)

    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_accessorsArray<Sandbox::FileAccessor>

Returns the file accessors for the specifications of this library.

Returns:



109
110
111
# File 'lib/cocoapods/library.rb', line 109

def file_accessors
  @file_accessors
end

#platformPlatform

Returns the platform for this library.

Returns:

  • (Platform)

    the platform for this library.



87
88
89
# File 'lib/cocoapods/library.rb', line 87

def platform
  @platform
end

#specsArray<Specification>

Returns the specifications of this library.

Returns:



104
105
106
# File 'lib/cocoapods/library.rb', line 104

def specs
  @specs
end

#support_files_rootPathname

Returns the folder where to store the support files of this library.

Returns:

  • (Pathname)

    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

#targetPBXNativeTarget

Returns the target generated in the Pods project for this library.

Returns:

  • (PBXNativeTarget)

    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_definitionPBXNativeTarget (readonly)

Returns the target definition of the Podfile that generated this library.

Returns:

  • (PBXNativeTarget)

    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_configurationsHash{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`).

Returns:

  • (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`).



83
84
85
# File 'lib/cocoapods/library.rb', line 83

def user_build_configurations
  @user_build_configurations
end

#user_project_pathPathname

Note:

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.

Returns:

  • (Pathname)

    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_uuidsString

Note:

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.

Returns:

  • (String)

    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

#xcconfigXcodeproj::Config

Note:

The configuration is generated by the TargetInstaller and used by UserProjectIntegrator to check for any overridden values.

Returns the configuration file of the library.

Returns:

  • (Xcodeproj::Config)

    the configuration file of the library



100
101
102
# File 'lib/cocoapods/library.rb', line 100

def xcconfig
  @xcconfig
end

Instance Method Details

#acknowledgements_basepathPathname

Note:

The acknowledgements generators add the extension according to the file type.

Returns the absolute path of acknowledgements file.

Returns:

  • (Pathname)

    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_pathPathname

Returns the absolute path of the bridge support file.

Returns:

  • (Pathname)

    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_pathPathname

Returns the absolute path of the copy resources script.

Returns:

  • (Pathname)

    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_pathString

Returns the path of the copy resources script relative to the root of the user project.

Returns:

  • (String)

    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_pathPathname

Returns the path of the dummy source generated by CocoaPods.

Returns:

  • (Pathname)

    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

#inspectString

Returns A string suitable for debugging.

Returns:

  • (String)

    A string suitable for debugging.



43
44
45
# File 'lib/cocoapods/library.rb', line 43

def inspect
  "<#{self.class} name=#{name} platform=#{platform}>"
end

#labelString

Returns the label for the library.

Returns:

  • (String)

    the label for the library.



25
26
27
# File 'lib/cocoapods/library.rb', line 25

def label
  target_definition.label.to_s
end

#nameString

Returns the name of the library.

Returns:

  • (String)

    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_pathPathname

Returns the absolute path of the prefix header file.

Returns:

  • (Pathname)

    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_nameString

Returns the name of the library.

Returns:

  • (String)

    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_rootString

Returns The xcconfig path of the root from the ‘$(SRCROOT)` variable of the user’s project.

Returns:

  • (String)

    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_pathPathname

Returns the absolute path of the header file which contains the information about the installed pods.

Returns:

  • (Pathname)

    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_pathPathname

Returns the absolute path of the xcconfig file.

Returns:

  • (Pathname)

    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_pathString

Returns the path of the xcconfig file relative to the root of the user project.

Returns:

  • (String)

    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