class Pod::Installer::Analyzer::PodVariant
Bundles the information needed to setup a {PodTarget}.
Attributes
@return [Array<Specification>] the app specs for the target
@return [BuildType] the build type of the target
Hashes the instance by all its attributes.
This adds support to make instances usable as Hash keys.
@!visibility private
@return [Platform] the platform
@return [Array<Specification>] the spec and subspecs for the target
@return [String] the Swift version of the target.
@return [Array<Specification>] the test specs for the target
Public Class Methods
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
@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 [Bool] 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
@return [Specification] the root specification
# File lib/cocoapods/installer/analyzer/pod_variant.rb, line 52 def root_spec specs.first.root end
@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