Class: Pod::Target

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

AggregateTarget, PodTarget

Information storage collapse

Instance Attribute Summary collapse

Information storage collapse

Support files collapse

Instance Method Summary collapse

Instance Attribute Details

#archsString

Returns The value for the ARCHS build setting.

Returns:

  • (String)

    The value for the ARCHS build setting.



65
66
67
# File 'lib/cocoapods/target.rb', line 65

def archs
  @archs
end

#sandboxSandbox (readonly)

Returns The sandbox where the Pods should be installed.

Returns:

  • (Sandbox)

    The sandbox where the Pods should be installed.



16
17
18
# File 'lib/cocoapods/target.rb', line 16

def sandbox
  @sandbox
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.



55
56
57
# File 'lib/cocoapods/target.rb', line 55

def target
  @target
end

#target_definitionPBXNativeTarget (readonly)

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

Returns:

  • (PBXNativeTarget)

    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_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).



50
51
52
# File 'lib/cocoapods/target.rb', line 50

def user_build_configurations
  @user_build_configurations
end

Instance Method Details

#bridge_support_pathPathname

Returns the absolute path of the bridge support file.

Returns:

  • (Pathname)

    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_pathPathname

Returns the path of the dummy source generated by CocoaPods.

Returns:

  • (Pathname)

    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

#inspectString

Returns A string suitable for debugging.

Returns:

  • (String)

    A string suitable for debugging.



38
39
40
# File 'lib/cocoapods/target.rb', line 38

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

#nameString

Returns the name of the library.

Returns:

  • (String)

    the name of the library.



20
21
22
# File 'lib/cocoapods/target.rb', line 20

def name
  label
end

#platformPlatform

Returns the platform for this library.

Returns:

  • (Platform)

    the platform for this library.



59
60
61
# File 'lib/cocoapods/target.rb', line 59

def platform
  @platform ||= target_definition.platform
end

#prefix_header_pathPathname

Returns the absolute path of the prefix header file.

Returns:

  • (Pathname)

    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_nameString

Returns the name of the library.

Returns:

  • (String)

    the name of the library.



26
27
28
# File 'lib/cocoapods/target.rb', line 26

def product_name
  "lib#{label}.a"
end

#support_files_dirPathname

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.



74
75
76
# File 'lib/cocoapods/target.rb', line 74

def support_files_dir
  sandbox.target_support_files_dir(name)
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.



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.

Parameters:

  • variant (String) (defaults to: nil)

    The variant of the xcconfig. Used to differentiate build configurations.

Returns:

  • (Pathname)

    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_prefixString

Returns the XCConfig namespaced prefix.

Returns:

  • (String)

    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_pathPathname

Returns the absolute path of the private xcconfig file.

Returns:

  • (Pathname)

    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