Class: Pod::Podfile::TargetDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-core/podfile/target_definition.rb

Overview

The TargetDefinition stores the information of a CocoaPods static library. The target definition can be linked with one or more targets of the user project.

Target definitions can be nested and by default inherit the dependencies of the parent.

Attributes collapse

PLATFORM_DEFAULTS =

--------------------------------------#

{ :ios => '4.3', :osx => '10.6', :watchos => '2.0' }.freeze

Representations collapse

HASH_KEYS =

Returns The keys used by the hash representation of the target definition.

Returns:

  • (Array)

    The keys used by the hash representation of the target definition.

%w(
  name
  platform
  podspecs
  exclusive
  link_with
  link_with_first_target
  inhibit_warnings
  user_project_path
  build_configurations
  dependencies
  children
  configuration_pod_whitelist
  uses_frameworks
).freeze

Private helpers collapse

Instance Attribute Summary collapse

Attributes collapse

Representations collapse

Private helpers collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, parent, internal_hash = nil) ⇒ TargetDefinition

Returns a new instance of TargetDefinition

Parameters:

  • name (String, Symbol)

    @see name

  • parent (TargetDefinition)

    @see parent

  • options (Hash)

    a customizable set of options


25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 25

def initialize(name, parent, internal_hash = nil)
  @internal_hash = internal_hash || {}
  @parent = parent
  @children = []

  unless internal_hash
    self.name = name
  end
  if parent.is_a?(TargetDefinition)
    parent.children << self
  end
end

Instance Attribute Details

#childrenArray<TargetDefinition>

Returns the children target definitions.

Returns:


40
41
42
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 40

def children
  @children
end

#internal_hashHash (private)

Returns The hash which store the attributes of the target definition.

Returns:

  • (Hash)

    The hash which store the attributes of the target definition.


580
581
582
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 580

def internal_hash
  @internal_hash
end

#parentTargetDefinition, Podfile (readonly)

Returns the parent target definition or the Podfile if the receiver is root.

Returns:


14
15
16
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 14

def parent
  @parent
end

Class Method Details

.from_hash(hash, parent) ⇒ TargetDefinition

Configures a new target definition from the given hash.

Parameters:

  • the (Hash)

    hash which contains the information of the Podfile.

Returns:


557
558
559
560
561
562
563
564
565
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 557

def self.from_hash(hash, parent)
  internal_hash = hash.dup
  children_hashes = internal_hash.delete('children') || []
  definition = TargetDefinition.new(nil, parent, internal_hash)
  children_hashes.each do |child_hash|
    TargetDefinition.from_hash(child_hash, definition)
  end
  definition
end

Instance Method Details

#all_whitelisted_configurationsArray<String>

Returns unique list of all configurations for which pods have been whitelisted.

Returns:

  • (Array<String>)

    unique list of all configurations for which pods have been whitelisted.


398
399
400
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 398

def all_whitelisted_configurations
  configuration_pod_whitelist.keys.uniq
end

#build_configurationsHash{String => symbol}

Returns A hash where the keys are the name of the build configurations and the values a symbol that represents their type (:debug or :release).

Returns:

  • (Hash{String => symbol})

    A hash where the keys are the name of the build configurations and the values a symbol that represents their type (:debug or :release).


256
257
258
259
260
261
262
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 256

def build_configurations
  if root?
    get_hash_value('build_configurations')
  else
    get_hash_value('build_configurations') || parent.build_configurations
  end
end

#build_configurations=(hash) ⇒ Hash{String => Symbol}, void

Sets the build configurations for this target.

Returns:

  • (Hash{String => Symbol})

    hash A hash where the keys are the name of the build configurations and the values the type.

  • (void)

272
273
274
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 272

def build_configurations=(hash)
  set_hash_value('build_configurations', hash) unless hash.empty?
end

#configuration_pod_whitelistHash<String, Array> (private)

Returns the configuration_pod_whitelist hash

Returns:

  • (Hash<String, Array>)

    Hash with configuration name as key, array of pod names to be linked in builds with that configuration as value.


637
638
639
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 637

def configuration_pod_whitelist
  get_hash_value('configuration_pod_whitelist', {})
end

#dependenciesArray<Dependency>

Returns The list of the dependencies of the target definition including the inherited ones.

Returns:

  • (Array<Dependency>)

    The list of the dependencies of the target definition including the inherited ones.


75
76
77
78
79
80
81
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 75

def dependencies
  if exclusive? || parent.nil?
    non_inherited_dependencies
  else
    non_inherited_dependencies + parent.dependencies
  end
end

#empty?Bool

Returns Whether the target definition has at least one dependency, excluding inherited ones.

Returns:

  • (Bool)

    Whether the target definition has at least one dependency, excluding inherited ones.


93
94
95
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 93

def empty?
  non_inherited_dependencies.empty?
end

#exclusive=(flag) ⇒ void

This method returns an undefined value.

Sets whether the target definition is exclusive.

Parameters:

  • flag (Bool)

    Whether the definition is exclusive.


172
173
174
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 172

def exclusive=(flag)
  set_hash_value('exclusive', flag)
end

#exclusive?Bool

Note:

A target is always exclusive if it is root.

Note:

A target is always exclusive if the platform does not match the parent's platform.

Returns whether the target definition should inherit the dependencies of the parent.

Returns:

  • (Bool)

    whether is exclusive.


155
156
157
158
159
160
161
162
163
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 155

def exclusive?
  if root?
    true
  elsif get_hash_value('exclusive')
    true
  else
    platform && parent && parent.platform != platform
  end
end

#get_hash_value(key, base_value = nil) ⇒ Object (private)

Returns the value for the given key in the internal hash of the target definition.

Parameters:

  • key (String)

    The key for which the value is needed.

  • base_value (Object) (defaults to: nil)

    The value to set if they key is nil. Useful for collections.

Returns:

  • (Object)

    The value for the key.

Raises:

  • If the key is not recognized.


615
616
617
618
619
620
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 615

def get_hash_value(key, base_value = nil)
  unless HASH_KEYS.include?(key)
    raise StandardError, "Unsupported hash key `#{key}`"
  end
  internal_hash[key] ||= base_value
end

#inhibit_all_warnings=(flag) ⇒ void

This method returns an undefined value.

Sets whether the target definition should inhibit the warnings during compilation for all pods.

Parameters:

  • flag (Bool)

    Whether the warnings should be suppressed.


301
302
303
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 301

def inhibit_all_warnings=(flag)
  inhibit_warnings_hash['all'] = flag
end

#inhibit_warnings_for_pod(pod_name) ⇒ void

This method returns an undefined value.

Inhibits warnings for a specific pod during compilation.

Parameters:

  • pod (String)

    name Whether the warnings should be suppressed.


312
313
314
315
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 312

def inhibit_warnings_for_pod(pod_name)
  inhibit_warnings_hash['for_pods'] ||= []
  inhibit_warnings_hash['for_pods'] << pod_name
end

#inhibit_warnings_hashHash<String, Array> (private)

Returns the inhibit_warnings hash pre-populated with default values.

Returns:

  • (Hash<String, Array>)

    Hash with :all key for inhibiting all warnings, and :for_pods key for inhibiting warnings per Pod.


627
628
629
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 627

def inhibit_warnings_hash
  get_hash_value('inhibit_warnings', {})
end

#inhibits_warnings_for_pod?(pod_name) ⇒ Bool

Whether the target definition should inhibit warnings for a single pod. If inhibit_all_warnings is true, it will return true for any asked pod.

Returns:

  • (Bool)

    whether the target definition should inhibit warnings for a single pod. If inhibit_all_warnings is true, it will return true for any asked pod.


282
283
284
285
286
287
288
289
290
291
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 282

def inhibits_warnings_for_pod?(pod_name)
  if inhibit_warnings_hash['all']
    true
  elsif !root? && parent.inhibits_warnings_for_pod?(pod_name)
    true
  else
    inhibit_warnings_hash['for_pods'] ||= []
    inhibit_warnings_hash['for_pods'].include? pod_name
  end
end

#inspectString

Returns A string representation suitable for debug.

Returns:

  • (String)

    A string representation suitable for debug.


114
115
116
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 114

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

#labelString Also known as: to_s

Returns The label of the target definition according to its name.

Returns:

  • (String)

    The label of the target definition according to its name.


100
101
102
103
104
105
106
107
108
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 100

def label
  if root? && name == 'Pods'
    'Pods'
  elsif exclusive? || parent.nil?
    "Pods-#{name}"
  else
    "#{parent.label}-#{name}"
  end
end

Returns The list of the names of the Xcode targets with which this target definition should be linked with.

Returns:

  • (Array<String>)

    The list of the names of the Xcode targets with which this target definition should be linked with.


181
182
183
184
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 181

def link_with
  value = get_hash_value('link_with')
  value unless value.nil? || value.empty?
end

This method returns an undefined value.

Sets the client targets that should be integrated by this definition.

Parameters:

  • targets (Array<String>)

    The list of the targets names.


193
194
195
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 193

def link_with=(targets)
  set_hash_value('link_with', Array(targets).map(&:to_s))
end
Note:

This option is ignored if #link_with is set.

This method returns an undefined value.

Sets whether the target definition should link with the first target of the project.

Parameters:

  • flag (Bool)

    Whether the definition should link with the first target.


220
221
222
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 220

def link_with_first_target=(flag)
  set_hash_value('link_with_first_target', flag)
end
Note:

This option is ignored if #link_with is set.

Returns whether the target definition should link with the first target of the project.

Returns:

  • (Bool)

    whether is exclusive.


206
207
208
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 206

def link_with_first_target?
  get_hash_value('link_with_first_target') unless link_with
end

#nameString

Returns the path of the project this target definition should link with.

Returns:

  • (String)

    the path of the project this target definition should link with.


127
128
129
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 127

def name
  get_hash_value('name')
end

#name=(name) ⇒ void

This method returns an undefined value.

Sets the path of the user project this target definition should link with.

Parameters:

  • path (String)

    The path of the project.


139
140
141
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 139

def name=(name)
  set_hash_value('name', name)
end

#non_inherited_dependenciesArray

Returns The list of the dependencies of the target definition, excluding inherited ones.

Returns:

  • (Array)

    The list of the dependencies of the target definition, excluding inherited ones.


86
87
88
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 86

def non_inherited_dependencies
  pod_dependencies.concat(podspec_dependencies)
end

#parse_configuration_whitelist(name, requirements) ⇒ void (private)

This method returns an undefined value.

Removes :configurations or :configuration from the requirements list, and adds the pod's name into the internal hash for which pods should be linked in which configuration only.

Parameters:

  • pod (String)

    name

  • requirements (Array)

    If :configurations is the only key in the hash, the hash should be destroyed because it confuses Gem::Dependency.


735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 735

def parse_configuration_whitelist(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)

  configurations = options.delete(:configurations)
  configurations ||= options.delete(:configuration)
  if configurations
    Array(configurations).each do |configuration|
      whitelist_pod_for_configuration(name, configuration)
    end
  end
  requirements.pop if options.empty?
end

#parse_inhibit_warnings(name, requirements) ⇒ void (private)

This method returns an undefined value.

Removes :inhibit_warnings from the requirements list, and adds the pod's name into internal hash for disabling warnings.

Parameters:

  • pod (String)

    name

  • requirements (Array)

    If :inhibit_warnings is the only key in the hash, the hash should be destroyed because it confuses Gem::Dependency.


713
714
715
716
717
718
719
720
721
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 713

def parse_inhibit_warnings(name, requirements)
  options = requirements.last
  return requirements unless options.is_a?(Hash)

  should_inhibit = options.delete(:inhibit_warnings)
  inhibit_warnings_for_pod(Specification.root_name name) if should_inhibit

  requirements.pop if options.empty?
end

#parse_subspecs(name, requirements) ⇒ Boolean (private)

Removes :subspecs form the requirements list, and stores the pods with the given subspecs as dependencies.

Parameters:

  • name (String)
  • requirements (Array)

    If :subspecs is the only key in the hash, the hash should be destroyed because it confuses Gem::Dependency.

Returns:

  • (Boolean)

    Whether new subspecs were added


760
761
762
763
764
765
766
767
768
769
770
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 760

def parse_subspecs(name, requirements)
  options = requirements.last
  return false unless options.is_a?(Hash)

  subspecs = options.delete(:subspecs)
  subspecs.each do |ss|
    store_pod("#{name}/#{ss}", *requirements.dup)
  end if subspecs
  requirements.pop if options.empty?
  !subspecs.nil?
end

#platformPlatform

Note:

If no deployment target has been specified a default value is provided.

Returns the platform of the target definition.

Returns:

  • (Platform)

    the platform of the target definition.


411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 411

def platform
  name_or_hash = get_hash_value('platform')
  if name_or_hash
    if name_or_hash.is_a?(Hash)
      name = name_or_hash.keys.first.to_sym
      target = name_or_hash.values.first
    else
      name = name_or_hash.to_sym
    end
    target ||= PLATFORM_DEFAULTS[name]
    Platform.new(name, target)
  else
    parent.platform unless root?
  end
end

#pod_dependenciesArray<Dependency> (private)

Returns The dependencies specified by the user for this target definition.

Returns:

  • (Array<Dependency>)

    The dependencies specified by the user for this target definition.


644
645
646
647
648
649
650
651
652
653
654
655
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 644

def pod_dependencies
  pods = get_hash_value('dependencies') || []
  pods.map do |name_or_hash|
    if name_or_hash.is_a?(Hash)
      name = name_or_hash.keys.first
      requirements = name_or_hash.values.first
      Dependency.new(name, *requirements)
    else
      Dependency.new(name_or_hash)
    end
  end
end

#pod_whitelisted_for_configuration?(pod_name, configuration_name) ⇒ Bool

Note:

Build configurations are case compared case-insensitively in CocoaPods.

Whether a specific pod should be linked to the target when building for a specific configuration. If a pod has not been explicitly whitelisted for any configuration, it is implicitly whitelisted.

Parameters:

  • pod_name (String)

    The pod that we're querying about inclusion for in the given configuration.

  • configuration_name (String)

    The configuration that we're querying about inclusion of the pod in.

Returns:

  • (Bool)

    flag Whether the pod should be linked with the target


361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 361

def pod_whitelisted_for_configuration?(pod_name, configuration_name)
  found = false
  configuration_pod_whitelist.each do |configuration, pods|
    if pods.include?(pod_name)
      found = true
      if configuration.downcase == configuration_name.to_s.downcase
        return true
      end
    end
  end
  !found
end

#podfilePodfile

Returns The podfile that contains the specification for this target definition.

Returns:

  • (Podfile)

    The podfile that contains the specification for this target definition.


68
69
70
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 68

def podfile
  root.parent
end

#podspec_dependenciesArray<Dependency> (private)

Note:

The podspec directive is intended include the dependencies of a spec in the project where it is developed. For this reason the spec, or any of it subspecs, cannot be included in the dependencies. Otherwise it would generate a chicken-and-egg problem.

Returns The dependencies inherited by the podspecs.

Returns:

  • (Array<Dependency>)

    The dependencies inherited by the podspecs.


665
666
667
668
669
670
671
672
673
674
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 665

def podspec_dependencies
  podspecs = get_hash_value('podspecs') || []
  podspecs.map do |options|
    file = podspec_path_from_options(options)
    spec = Specification.from_file(file)
    all_specs = [spec, *spec.recursive_subspecs]
    all_deps = all_specs.map { |s| s.dependencies(platform) }.flatten
    all_deps.reject { |dep| dep.root_name == spec.root.name }
  end.flatten.uniq
end

#podspec_path_from_options(options) ⇒ Pathname (private)

The path of the podspec with the given options.

Parameters:

  • options (Hash)

    The options to use for finding the podspec. The supported keys are: :name, :path, :autodetect.

Returns:

  • (Pathname)

    The path.


684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 684

def podspec_path_from_options(options)
  if path = options[:path]
    if File.basename(path).include?('.podspec')
      path_with_ext = path
    else
      path_with_ext = "#{path}.podspec"
    end
    path_without_tilde = path_with_ext.gsub('~', ENV['HOME'])
    podfile.defined_in_file.dirname + path_without_tilde
  elsif name = options[:name]
    name = File.basename(name).include?('.podspec') ? name : "#{name}.podspec"
    podfile.defined_in_file.dirname + name
  elsif options[:autodetect]
    glob_pattern = podfile.defined_in_file.dirname + '*.podspec{,.json}'
    Pathname.glob(glob_pattern).first
  end
end

#recursive_childrenArray<TargetDefinition>

Returns the targets definition descending from this one.

Returns:

  • (Array<TargetDefinition>)

    the targets definition descending from this one.


45
46
47
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 45

def recursive_children
  (children + children.map(&:recursive_children)).flatten
end

#rootTargetDefinition

Returns The root target definition.

Returns:


57
58
59
60
61
62
63
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 57

def root
  if root?
    self
  else
    parent.root
  end
end

#root?Bool

Returns Whether the target definition is root.

Returns:

  • (Bool)

    Whether the target definition is root.


51
52
53
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 51

def root?
  parent.is_a?(Podfile) || parent.nil?
end

#set_hash_value(key, value) ⇒ void (private)

This method returns an undefined value.

Set a value in the internal hash of the target definition for the given key.

Parameters:

  • key (String)

    The key for which to store the value.

  • value (Object)

    The value to store.

Raises:

  • If the key is not recognized.


595
596
597
598
599
600
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 595

def set_hash_value(key, value)
  unless HASH_KEYS.include?(key)
    raise StandardError, "Unsupported hash key `#{key}`"
  end
  internal_hash[key] = value
end

#set_platform(name, target = nil) ⇒ void

This method returns an undefined value.

Sets the platform of the target definition.

Parameters:

  • name (Symbol)

    The name of the platform.

  • target (String) (defaults to: nil)

    The deployment target of the platform.

Raises:

  • When the name of the platform is unsupported.


439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 439

def set_platform(name, target = nil)
  unless [:ios, :osx, :watchos].include?(name)
    raise StandardError, "Unsupported platform `#{name}`. Platform " \
      'must be `:ios`, `:osx`, or `:watchos`.'
  end

  if target
    value = { name.to_s => target }
  else
    value = name.to_s
  end
  set_hash_value('platform', value)
end

#store_pod(name, *requirements) ⇒ void

TODO:

This needs urgently a rename.

Note:

The dependencies are stored as an array. To simplify the YAML representation if they have requirements they are represented as a Hash, otherwise only the String of the name is added to the array.

This method returns an undefined value.

Stores the dependency for a Pod with the given name.

Parameters:

  • name (String)

    The name of the Pod

  • requirements (Array<String, Hash>)

    The requirements and the options of the dependency.


472
473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 472

def store_pod(name, *requirements)
  return if parse_subspecs(name, requirements) # This parse method must be called first
  parse_inhibit_warnings(name, requirements)
  parse_configuration_whitelist(name, requirements)

  if requirements && !requirements.empty?
    pod = { name => requirements }
  else
    pod = name
  end

  get_hash_value('dependencies', []) << pod
end

#store_podspec(options = nil) ⇒ void

TODO:

This needs urgently a rename.

Note:

The storage of this information is optimized for YAML readability.

This method returns an undefined value.

Stores the podspec whose dependencies should be included by the target.

Parameters:

  • options (Hash) (defaults to: nil)

    The options used to find the podspec (either by name or by path). If nil the podspec is auto-detected (i.e. the first one in the folder of the Podfile)


503
504
505
506
507
508
509
510
511
512
513
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 503

def store_podspec(options = nil)
  if options
    unless options.keys.all? { |key| [:name, :path].include?(key) }
      raise StandardError, 'Unrecognized options for the podspec ' \
        "method `#{options}`"
    end
    get_hash_value('podspecs', []) << options
  else
    get_hash_value('podspecs', []) << { :autodetect => true }
  end
end

#to_hashHash

Returns The hash representation of the target definition.

Returns:

  • (Hash)

    The hash representation of the target definition.


542
543
544
545
546
547
548
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 542

def to_hash
  hash = internal_hash.dup
  unless children.empty?
    hash['children'] = children.map(&:to_hash)
  end
  hash
end

#use_frameworks!(flag = true) ⇒ void

This method returns an undefined value.

Sets whether the target definition should build a framework.

Parameters:

  • flag (Bool) (defaults to: true)

    Whether a framework should be built.


326
327
328
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 326

def use_frameworks!(flag = true)
  set_hash_value('uses_frameworks', flag)
end

#user_project_pathString

Returns the path of the project this target definition should link with.

Returns:

  • (String)

    the path of the project this target definition should link with.


229
230
231
232
233
234
235
236
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 229

def user_project_path
  path = get_hash_value('user_project_path')
  if path
    File.extname(path) == '.xcodeproj' ? path : "#{path}.xcodeproj"
  else
    parent.user_project_path unless root?
  end
end

#user_project_path=(path) ⇒ void

This method returns an undefined value.

Sets the path of the user project this target definition should link with.

Parameters:

  • path (String)

    The path of the project.


246
247
248
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 246

def user_project_path=(path)
  set_hash_value('user_project_path', path)
end

#uses_frameworks?Bool

Returns whether the target definition should build a framework.

Returns:

  • (Bool)

    whether the target definition should build a framework.


333
334
335
336
337
338
339
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 333

def uses_frameworks?
  if internal_hash['uses_frameworks'].nil?
    root? ? false : parent.uses_frameworks?
  else
    get_hash_value('uses_frameworks')
  end
end

#whitelist_pod_for_configuration(pod_name, configuration_name) ⇒ void

Note:

Build configurations are stored as a String.

This method returns an undefined value.

Whitelists a pod for a specific configuration. If a pod is whitelisted for any configuration, it will only be linked with the target in the configuration(s) specified. If it is not whitelisted for any configuration, it is implicitly included in all configurations.

Parameters:

  • pod_name (String)

    The pod that should be included in the given configuration.

  • configuration_name (String, Symbol)

    The configuration that the pod should be included in


389
390
391
392
393
# File 'lib/cocoapods-core/podfile/target_definition.rb', line 389

def whitelist_pod_for_configuration(pod_name, configuration_name)
  configuration_name = configuration_name.to_s
  configuration_pod_whitelist[configuration_name] ||= []
  configuration_pod_whitelist[configuration_name] << pod_name
end