class Pod::Installer::Analyzer::PodVariant

Bundles the information needed to setup a {PodTarget}.

Attributes

app_specs[R]

@return [Array<Specification>] the app specs for the target

build_type[R]

@return [BuildType] the build type of the target

hash[R]

Hashes the instance by all its attributes.

This adds support to make instances usable as Hash keys.

@!visibility private

platform[R]

@return [Platform] the platform

specs[R]

@return [Array<Specification>] the spec and subspecs for the target

swift_version[R]

@return [String] the Swift version of the target.

test_specs[R]

@return [Array<Specification>] the test specs for the target

Public Class Methods

new(specs, test_specs, app_specs, platform, build_type = BuildType.static_library, swift_version = nil) click to toggle source

Initialize a new instance from its attributes.

@param [Array<Specification>] specs @see specs @param [Array<Specification>] test_specs @see test_specs @param [Array<Specification>] app_specs @see app_specs @param [Platform] platform @see platform @param [BuildType] build_type @see build_type @param [String] swift_version @see swift_version

# File lib/cocoapods/installer/analyzer/pod_variant.rb, line 39
def initialize(specs, test_specs, app_specs, platform, build_type = BuildType.static_library,
               swift_version = nil)
  @specs = specs
  @test_specs = test_specs
  @app_specs = app_specs
  @platform = platform
  @build_type = build_type
  @swift_version = swift_version
  @hash = [specs, platform, build_type, swift_version].hash
end

Public Instance Methods

==(other) click to toggle source

@note Non library specs are intentionally not included as part of the equality for pod variants since a pod

variant should not be affected by the number of test nor app specs included.

@return [Boolean] whether the {PodVariant} is equal to another taking all all their attributes into account

# File lib/cocoapods/installer/analyzer/pod_variant.rb, line 61
def ==(other)
  self.class == other.class &&
  build_type == other.build_type &&
    swift_version == other.swift_version &&
    platform == other.platform &&
    specs == other.specs
end
Also aliased as: eql?
eql?(other)
Alias for: ==
root_spec() click to toggle source

@return [Specification] the root specification

# File lib/cocoapods/installer/analyzer/pod_variant.rb, line 52
def root_spec
  specs.first.root
end
scoped_with_swift_version(swift_version) click to toggle source

@param [String] swift_version The swift version to use for this variant.

@return [PodVariant] A copy of this pod variant with the specified Swift version.

# File lib/cocoapods/installer/analyzer/pod_variant.rb, line 81
def scoped_with_swift_version(swift_version)
  PodVariant.new(specs, test_specs, app_specs, platform, build_type, swift_version)
end