Unverified Commit 212a5d3c authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7490 from dnkoutso/immutability_wins_2

Make more classes immutable
parents e0bac737 a2fb7a0a
...@@ -777,8 +777,7 @@ module Pod ...@@ -777,8 +777,7 @@ module Pod
resolver_specs_by_target = nil resolver_specs_by_target = nil
UI.section "Resolving dependencies of #{UI.path(podfile.defined_in_file) || 'Podfile'}" do UI.section "Resolving dependencies of #{UI.path(podfile.defined_in_file) || 'Podfile'}" do
resolver = Resolver.new(sandbox, podfile, locked_dependencies, sources) resolver = Resolver.new(sandbox, podfile, locked_dependencies, sources, specs_updated?)
resolver.specs_updated = specs_updated?
resolver_specs_by_target = resolver.resolve resolver_specs_by_target = resolver.resolve
resolver_specs_by_target.values.flatten(1).map(&:spec).each(&:validate_cocoapods_version) resolver_specs_by_target.values.flatten(1).map(&:spec).each(&:validate_cocoapods_version)
end end
...@@ -919,8 +918,7 @@ module Pod ...@@ -919,8 +918,7 @@ module Pod
project = Xcodeproj::Project.open(project_path) project = Xcodeproj::Project.open(project_path)
target_inspectors.each do |inspector| target_inspectors.each do |inspector|
target_definition = inspector.target_definition target_definition = inspector.target_definition
inspector.user_project = project results = inspector.compute_results(project)
results = inspector.compute_results
inspection_result[target_definition] = results inspection_result[target_definition] = results
UI.message('Using `ARCHS` setting to build architectures of ' \ UI.message('Using `ARCHS` setting to build architectures of ' \
"target `#{target_definition.label}`: (`#{results.archs.join('`, `')}`)") "target `#{target_definition.label}`: (`#{results.archs.join('`, `')}`)")
......
...@@ -12,6 +12,22 @@ module Pod ...@@ -12,6 +12,22 @@ module Pod
# subspecs are added instead of the name of the Pods. # subspecs are added instead of the name of the Pods.
# #
class SpecsState class SpecsState
# @return [Set<String>] the names of the pods that were added.
#
attr_reader :added
# @return [Set<String>] the names of the pods that were changed.
#
attr_reader :changed
# @return [Set<String>] the names of the pods that were deleted.
#
attr_reader :deleted
# @return [Set<String>] the names of the pods that were unchanged.
#
attr_reader :unchanged
# Initialize a new instance # Initialize a new instance
# #
# @param [Hash{Symbol=>String}] pods_by_state # @param [Hash{Symbol=>String}] pods_by_state
...@@ -38,22 +54,6 @@ module Pod ...@@ -38,22 +54,6 @@ module Pod
end end
end end
# @return [Set<String>] the names of the pods that were added.
#
attr_accessor :added
# @return [Set<String>] the names of the pods that were changed.
#
attr_accessor :changed
# @return [Set<String>] the names of the pods that were deleted.
#
attr_accessor :deleted
# @return [Set<String>] the names of the pods that were unchanged.
#
attr_accessor :unchanged
# Displays the state of each pod. # Displays the state of each pod.
# #
# @return [void] # @return [void]
......
...@@ -8,11 +8,12 @@ module Pod ...@@ -8,11 +8,12 @@ module Pod
# @return [TargetDefinition] the target definition to inspect # @return [TargetDefinition] the target definition to inspect
# #
attr_accessor :target_definition attr_reader :target_definition
# @return [Pathname] the root of the CocoaPods installation where the # @return [Pathname] the root of the CocoaPods installation where the
# Podfile is located # Podfile is located
attr_accessor :installation_root #
attr_reader :installation_root
# Initialize a new instance # Initialize a new instance
# #
...@@ -33,7 +34,7 @@ module Pod ...@@ -33,7 +34,7 @@ module Pod
# #
# @return [TargetInspectionResult] # @return [TargetInspectionResult]
# #
def compute_results def compute_results(user_project)
raise ArgumentError, 'Cannot compute results without a user project set' unless user_project raise ArgumentError, 'Cannot compute results without a user project set' unless user_project
targets = compute_targets(user_project) targets = compute_targets(user_project)
...@@ -81,11 +82,6 @@ module Pod ...@@ -81,11 +82,6 @@ module Pod
path path
end end
# @return [Xcodeproj::Project] the user's Xcode project, used for target
# inspection
#
attr_accessor :user_project
#-----------------------------------------------------------------------# #-----------------------------------------------------------------------#
private private
...@@ -115,7 +111,7 @@ module Pod ...@@ -115,7 +111,7 @@ module Pod
[target] [target]
end end
# @param [Array<PBXNativeTarget] the user's targets of the project of # @param [Array<PBXNativeTarget] user_targets the user's targets of the project of
# #target_definition which needs to be integrated # #target_definition which needs to be integrated
# #
# @return [Hash{String=>Symbol}] A hash representing the user build # @return [Hash{String=>Symbol}] A hash representing the user build
...@@ -132,7 +128,7 @@ module Pod ...@@ -132,7 +128,7 @@ module Pod
end end
end end
# @param [Array<PBXNativeTarget] the user's targets of the project of # @param [Array<PBXNativeTarget] user_targets the user's targets of the project of
# #target_definition which needs to be integrated # #target_definition which needs to be integrated
# #
# @return [Platform] The platform of the user's targets # @return [Platform] The platform of the user's targets
...@@ -171,7 +167,7 @@ module Pod ...@@ -171,7 +167,7 @@ module Pod
# Computes the architectures relevant for the user's targets. # Computes the architectures relevant for the user's targets.
# #
# @param [Array<PBXNativeTarget] the user's targets of the project of # @param [Array<PBXNativeTarget] user_targets the user's targets of the project of
# #target_definition which needs to be integrated # #target_definition which needs to be integrated
# #
# @return [Array<String>] # @return [Array<String>]
......
...@@ -71,11 +71,11 @@ module Pod ...@@ -71,11 +71,11 @@ module Pod
# @return [Array<Source>] The list of the sources which will be used for # @return [Array<Source>] The list of the sources which will be used for
# the resolution. # the resolution.
# #
attr_accessor :sources attr_reader :sources
# @return [Bool] Whether the resolver has sources repositories up-to-date. # @return [Bool] Whether the resolver has sources repositories up-to-date.
# #
attr_accessor :specs_updated attr_reader :specs_updated
alias specs_updated? specs_updated alias specs_updated? specs_updated
# Init a new Resolver # Init a new Resolver
...@@ -84,14 +84,18 @@ module Pod ...@@ -84,14 +84,18 @@ module Pod
# @param [Podfile] podfile @see podfile # @param [Podfile] podfile @see podfile
# @param [Array<Dependency>] locked_dependencies @see locked_dependencies # @param [Array<Dependency>] locked_dependencies @see locked_dependencies
# @param [Array<Source>, Source] sources @see sources # @param [Array<Source>, Source] sources @see sources
# @param [Boolean] specs_updated @see specs_updated
# @param [PodfileDependencyCache] podfile_dependency_cache the podfile dependency cache to use
# within this Resolver.
# #
def initialize(sandbox, podfile, locked_dependencies, sources, def initialize(sandbox, podfile, locked_dependencies, sources, specs_updated,
podfile_dependency_cache: Installer::Analyzer::PodfileDependencyCache.from_podfile(podfile)) podfile_dependency_cache: Installer::Analyzer::PodfileDependencyCache.from_podfile(podfile))
@sandbox = sandbox @sandbox = sandbox
@podfile = podfile @podfile = podfile
@podfile_dependency_cache = podfile_dependency_cache
@locked_dependencies = locked_dependencies @locked_dependencies = locked_dependencies
@sources = Array(sources) @sources = Array(sources)
@specs_updated = specs_updated
@podfile_dependency_cache = podfile_dependency_cache
@platforms_by_dependency = Hash.new { |h, k| h[k] = [] } @platforms_by_dependency = Hash.new { |h, k| h[k] = [] }
@cached_sets = {} @cached_sets = {}
end end
...@@ -344,7 +348,7 @@ module Pod ...@@ -344,7 +348,7 @@ module Pod
# one Pod installation, so different version of the same Pods for # one Pod installation, so different version of the same Pods for
# target definitions are not allowed. # target definitions are not allowed.
# #
attr_accessor :cached_sets attr_reader :cached_sets
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
...@@ -82,7 +82,7 @@ module Pod ...@@ -82,7 +82,7 @@ module Pod
pod 'BlocksKit', '1.5.2' pod 'BlocksKit', '1.5.2'
end end
locked_deps = dependency_graph_from_array([Dependency.new('BlocksKit', '1.5.2')]) locked_deps = dependency_graph_from_array([Dependency.new('BlocksKit', '1.5.2')])
@resolver = Resolver.new(config.sandbox, @podfile, locked_deps, config.sources_manager.all) @resolver = Resolver.new(config.sandbox, @podfile, locked_deps, config.sources_manager.all, false)
end end
it 'returns the sandbox' do it 'returns the sandbox' do
...@@ -140,7 +140,7 @@ module Pod ...@@ -140,7 +140,7 @@ module Pod
platform :ios platform :ios
pod 'Reachability', :podspec => podspec pod 'Reachability', :podspec => podspec
end end
resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all, false)
resolver.resolve resolver.resolve
specs = resolver.resolver_specs_by_target.values.flatten specs = resolver.resolver_specs_by_target.values.flatten
specs.map(&:spec).map(&:to_s).should == ['Reachability (3.0.0)'] specs.map(&:spec).map(&:to_s).should == ['Reachability (3.0.0)']
...@@ -150,7 +150,7 @@ module Pod ...@@ -150,7 +150,7 @@ module Pod
@podfile = Podfile.new do @podfile = Podfile.new do
platform :ios platform :ios
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should == [] specs.should == []
end end
...@@ -159,8 +159,8 @@ module Pod ...@@ -159,8 +159,8 @@ module Pod
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
describe 'Resolution' do describe 'Resolution' do
def create_resolver(podfile = @podfile, locked_deps = empty_graph) def create_resolver(podfile = @podfile, locked_deps = empty_graph, specs_updated = false)
@resolver = Resolver.new(config.sandbox, podfile, locked_deps, config.sources_manager.all) @resolver = Resolver.new(config.sandbox, podfile, locked_deps, config.sources_manager.all, specs_updated)
end end
it 'cross resolves dependencies' do it 'cross resolves dependencies' do
...@@ -560,8 +560,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -560,8 +560,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
platform :ios platform :ios
pod 'AFNetworking', '999.999.999' pod 'AFNetworking', '999.999.999'
end end
resolver = create_resolver(podfile) resolver = create_resolver(podfile, empty_graph, true)
resolver.specs_updated = true
e = lambda { resolver.resolve }.should.raise NoSpecFoundError e = lambda { resolver.resolve }.should.raise NoSpecFoundError
e.message.should.include <<-EOS.strip e.message.should.include <<-EOS.strip
[!] CocoaPods could not find compatible versions for pod "AFNetworking": [!] CocoaPods could not find compatible versions for pod "AFNetworking":
...@@ -640,7 +639,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -640,7 +639,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
describe 'concerning dependencies that are scoped by consumer platform' do describe 'concerning dependencies that are scoped by consumer platform' do
def resolve def resolve
Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all).resolve Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false).resolve
end end
# AFNetworking Has an 'AFNetworking/UIKit' iOS-only default subspec # AFNetworking Has an 'AFNetworking/UIKit' iOS-only default subspec
...@@ -715,13 +714,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -715,13 +714,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
end end
file = fixture('spec-repos/test_repo/JSONKit/999.999.999/JSONKit.podspec') file = fixture('spec-repos/test_repo/JSONKit/999.999.999/JSONKit.podspec')
sources = config.sources_manager.sources(%w(master test_repo)) sources = config.sources_manager.sources(%w(master test_repo))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
spec = resolver.resolve.values.flatten.first.spec spec = resolver.resolve.values.flatten.first.spec
spec.version.to_s.should == '999.999.999' spec.version.to_s.should == '999.999.999'
spec.defined_in_file.should == file spec.defined_in_file.should == file
sources = config.sources_manager.sources(%w(test_repo master)) sources = config.sources_manager.sources(%w(test_repo master))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
spec = resolver.resolve.values.flatten.first.spec spec = resolver.resolve.values.flatten.first.spec
spec.version.to_s.should == '999.999.999' spec.version.to_s.should == '999.999.999'
resolver.resolve.values.flatten.first.spec.defined_in_file.should == file resolver.resolve.values.flatten.first.spec.defined_in_file.should == file
...@@ -734,13 +733,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -734,13 +733,13 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'JSONKit', '1.4' pod 'JSONKit', '1.4'
end end
sources = config.sources_manager.sources(%w(master test_repo)) sources = config.sources_manager.sources(%w(master test_repo))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
spec = resolver.resolve.values.flatten.first.spec spec = resolver.resolve.values.flatten.first.spec
spec.version.to_s.should == '1.4' spec.version.to_s.should == '1.4'
spec.defined_in_file.should == fixture('spec-repos/master/Specs/1/3/f/JSONKit/1.4/JSONKit.podspec.json') spec.defined_in_file.should == fixture('spec-repos/master/Specs/1/3/f/JSONKit/1.4/JSONKit.podspec.json')
sources = config.sources_manager.sources(%w(test_repo master)) sources = config.sources_manager.sources(%w(test_repo master))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
spec = resolver.resolve.values.flatten.first.spec spec = resolver.resolve.values.flatten.first.spec
spec.version.to_s.should == '1.4' spec.version.to_s.should == '1.4'
resolver.resolve.values.flatten.first.spec.defined_in_file.should == fixture('spec-repos/test_repo/JSONKit/1.4/JSONKit.podspec') resolver.resolve.values.flatten.first.spec.defined_in_file.should == fixture('spec-repos/test_repo/JSONKit/1.4/JSONKit.podspec')
...@@ -791,7 +790,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -791,7 +790,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'Data', '~> 1.0' pod 'Data', '~> 1.0'
end end
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
resolver.resolve.values.flatten.map { |rs| rs.spec.to_s }.sort. resolver.resolve.values.flatten.map { |rs| rs.spec.to_s }.sort.
should == ['Core (1.0.1)', 'Data (1.0.1)', 'Data/Tests (1.0.1)', 'Testing (1.0.1)'] should == ['Core (1.0.1)', 'Data (1.0.1)', 'Data/Tests (1.0.1)', 'Testing (1.0.1)']
end end
...@@ -805,7 +804,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -805,7 +804,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
end end
sources = config.sources_manager.sources(%w(master test_repo)) sources = config.sources_manager.sources(%w(master test_repo))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
resolver.resolve resolver.resolve
UI.warnings.should.not.match /multiple specifications/ UI.warnings.should.not.match /multiple specifications/
...@@ -820,7 +819,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -820,7 +819,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
end end
sources = config.sources_manager.sources(%w(master)) sources = config.sources_manager.sources(%w(master))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
e = lambda { resolver.resolve }.should.raise Informative e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/None of your spec sources contain a spec/) e.message.should.match(/None of your spec sources contain a spec/)
e.message.should.match(/JSONKit/) e.message.should.match(/JSONKit/)
...@@ -837,7 +836,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -837,7 +836,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
sources = config.sources_manager.sources(%w(test_repo)) sources = config.sources_manager.sources(%w(test_repo))
sources.map(&:url).should.not.include(master_repo_url) sources.map(&:url).should.not.include(master_repo_url)
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
spec = resolver.resolve.values.flatten.first.spec spec = resolver.resolve.values.flatten.first.spec
spec.version.to_s.should == '1.5pre' spec.version.to_s.should == '1.5pre'
spec.defined_in_file.should == fixture('spec-repos/master/Specs/1/3/f/JSONKit/1.5pre/JSONKit.podspec.json') spec.defined_in_file.should == fixture('spec-repos/master/Specs/1/3/f/JSONKit/1.5pre/JSONKit.podspec.json')
...@@ -855,7 +854,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -855,7 +854,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
end end
sources = config.sources_manager.sources(%w(master test_repo)) sources = config.sources_manager.sources(%w(master test_repo))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
resolver.resolve resolver.resolve
possible_specs = resolver.search_for(Dependency.new('JSONKit', '1.4')) possible_specs = resolver.search_for(Dependency.new('JSONKit', '1.4'))
...@@ -876,7 +875,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -876,7 +875,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
# CrossRepoDependent depends on AFNetworking which is only available in the master repo. # CrossRepoDependent depends on AFNetworking which is only available in the master repo.
sources = config.sources_manager.sources(%w(master)) sources = config.sources_manager.sources(%w(master))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
resolver.resolve resolver.resolve
specs = resolver.resolve.values.flatten.map(&:spec) specs = resolver.resolve.values.flatten.map(&:spec)
...@@ -891,7 +890,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -891,7 +890,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
# Check that if the master source is not available the dependency cannot be resolved. # Check that if the master source is not available the dependency cannot be resolved.
sources = config.sources_manager.sources(%w(test_repo)) sources = config.sources_manager.sources(%w(test_repo))
resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources) resolver = Resolver.new(config.sandbox, podfile, empty_graph, sources, false)
e = lambda { resolver.resolve }.should.raise Informative e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/Unable to find a specification for/) e.message.should.match(/Unable to find a specification for/)
...@@ -908,7 +907,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -908,7 +907,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '1.0RC3' pod 'AFNetworking', '1.0RC3'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should == ['AFNetworking (1.0RC3)'] specs.should == ['AFNetworking (1.0RC3)']
end end
...@@ -919,7 +918,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -919,7 +918,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '~> 1.0RC3' pod 'AFNetworking', '~> 1.0RC3'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should != ['AFNetworking (1.0RC3)'] specs.should != ['AFNetworking (1.0RC3)']
specs.should == ['AFNetworking (1.3.4)'] specs.should == ['AFNetworking (1.3.4)']
...@@ -931,7 +930,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -931,7 +930,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '1.0' pod 'AFNetworking', '1.0'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should != ['AFNetworking (1.0RC3)'] specs.should != ['AFNetworking (1.0RC3)']
specs.should == ['AFNetworking (1.0)'] specs.should == ['AFNetworking (1.0)']
...@@ -943,7 +942,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -943,7 +942,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '< 1.0' pod 'AFNetworking', '< 1.0'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should != ['AFNetworking (1.0RC3)'] specs.should != ['AFNetworking (1.0RC3)']
specs.should == ['AFNetworking (0.10.1)'] specs.should == ['AFNetworking (0.10.1)']
...@@ -955,7 +954,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -955,7 +954,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '<= 1.0' pod 'AFNetworking', '<= 1.0'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should != ['AFNetworking (1.0RC3)'] specs.should != ['AFNetworking (1.0RC3)']
specs.should == ['AFNetworking (1.0)'] specs.should == ['AFNetworking (1.0)']
...@@ -967,7 +966,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -967,7 +966,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '> 1.0', '< 1.3' pod 'AFNetworking', '> 1.0', '< 1.3'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should != ['AFNetworking (1.0RC3)'] specs.should != ['AFNetworking (1.0RC3)']
specs.should == ['AFNetworking (1.2.1)'] specs.should == ['AFNetworking (1.2.1)']
...@@ -979,7 +978,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -979,7 +978,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '>= 1.0', '< 1.3' pod 'AFNetworking', '>= 1.0', '< 1.3'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should != ['AFNetworking (1.0RC3)'] specs.should != ['AFNetworking (1.0RC3)']
specs.should == ['AFNetworking (1.2.1)'] specs.should == ['AFNetworking (1.2.1)']
...@@ -991,7 +990,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -991,7 +990,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
pod 'AFNetworking', '~> 1.0', '< 1.3' pod 'AFNetworking', '~> 1.0', '< 1.3'
end end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, @podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should != ['AFNetworking (1.0RC3)'] specs.should != ['AFNetworking (1.0RC3)']
specs.should == ['AFNetworking (1.2.1)'] specs.should == ['AFNetworking (1.2.1)']
...@@ -1002,7 +1001,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -1002,7 +1001,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
platform :ios platform :ios
pod 'PrereleaseMonkey' pod 'PrereleaseMonkey'
end end
resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all, false)
e = lambda { resolver.resolve }.should.raise Informative e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/There are only pre-release versions available satisfying the following requirements/) e.message.should.match(/There are only pre-release versions available satisfying the following requirements/)
e.message.should.match(/PrereleaseMonkey.*>= 0/) e.message.should.match(/PrereleaseMonkey.*>= 0/)
...@@ -1014,7 +1013,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -1014,7 +1013,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
platform :ios platform :ios
pod 'AFNetworking', '< 1.0', '> 0.10.1' pod 'AFNetworking', '< 1.0', '> 0.10.1'
end end
resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all, false)
e = lambda { resolver.resolve }.should.raise Informative e = lambda { resolver.resolve }.should.raise Informative
e.message.should.match(/There are only pre-release versions available satisfying the following requirements/) e.message.should.match(/There are only pre-release versions available satisfying the following requirements/)
e.message.should.match(/AFNetworking.*< 1\.0, > 0\.10\.1/) e.message.should.match(/AFNetworking.*< 1\.0, > 0\.10\.1/)
...@@ -1026,7 +1025,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -1026,7 +1025,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
platform :ios platform :ios
pod 'PrereleaseMonkey', '1.0-beta1' pod 'PrereleaseMonkey', '1.0-beta1'
end end
resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, podfile, empty_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should == ['PrereleaseMonkey (1.0-beta1)'] specs.should == ['PrereleaseMonkey (1.0-beta1)']
end end
...@@ -1048,7 +1047,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by ...@@ -1048,7 +1047,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
Dependency.new('LocalPod', '= 1.0.0.LOCAL'), Dependency.new('LocalPod', '= 1.0.0.LOCAL'),
Dependency.new('LocalPod2', '= 1.0.0.LOCAL'), Dependency.new('LocalPod2', '= 1.0.0.LOCAL'),
]) ])
resolver = Resolver.new(config.sandbox, podfile, locked_graph, config.sources_manager.all) resolver = Resolver.new(config.sandbox, podfile, locked_graph, config.sources_manager.all, false)
specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort specs = resolver.resolve.values.flatten.map(&:spec).map(&:to_s).sort
specs.should == ['LocalPod (1.0.0.LOCAL)', 'LocalPod2 (1.0.0.LOCAL)'] specs.should == ['LocalPod (1.0.0.LOCAL)', 'LocalPod2 (1.0.0.LOCAL)']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment