Commit 6ce4af80 authored by Fabio Pelosin's avatar Fabio Pelosin

Update for Core changes to Podfile

parent 2bcde0f0
...@@ -451,8 +451,8 @@ module Pod ...@@ -451,8 +451,8 @@ module Pod
end end
end end
target_definition.set_platform(name, deployment_target)
platform = Platform.new(name, deployment_target) platform = Platform.new(name, deployment_target)
target_definition.platform = platform
platform platform
end end
......
...@@ -176,7 +176,7 @@ module Pod ...@@ -176,7 +176,7 @@ module Pod
describe "#compute_user_project_targets" do describe "#compute_user_project_targets" do
it "uses the path specified in the target definition while computing the path of the user project" do it "uses the path specified in the target definition while computing the path of the user project" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.user_project_path = 'SampleProject/SampleProject' target_definition.user_project_path = 'SampleProject/SampleProject'
path = @analyzer.send(:compute_user_project_path, target_definition) path = @analyzer.send(:compute_user_project_path, target_definition)
...@@ -184,7 +184,7 @@ module Pod ...@@ -184,7 +184,7 @@ module Pod
end end
it "raises if the user project of the target definition does not exists while computing the path of the user project" do it "raises if the user project of the target definition does not exists while computing the path of the user project" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.user_project_path = 'Test' target_definition.user_project_path = 'Test'
e = lambda { @analyzer.send(:compute_user_project_path, target_definition) }.should.raise Informative e = lambda { @analyzer.send(:compute_user_project_path, target_definition) }.should.raise Informative
...@@ -192,7 +192,7 @@ module Pod ...@@ -192,7 +192,7 @@ module Pod
end end
it "if not specified in the target definition if looks if there is only one project" do it "if not specified in the target definition if looks if there is only one project" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
config.installation_root = config.installation_root + 'SampleProject' config.installation_root = config.installation_root + 'SampleProject'
path = @analyzer.send(:compute_user_project_path, target_definition) path = @analyzer.send(:compute_user_project_path, target_definition)
...@@ -200,7 +200,7 @@ module Pod ...@@ -200,7 +200,7 @@ module Pod
end end
it "if not specified in the target definition if looks if there is only one project" do it "if not specified in the target definition if looks if there is only one project" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
e = lambda { @analyzer.send(:compute_user_project_path, target_definition) }.should.raise Informative e = lambda { @analyzer.send(:compute_user_project_path, target_definition) }.should.raise Informative
e.message.should.match /Could not.*select.*project/ e.message.should.match /Could not.*select.*project/
...@@ -222,7 +222,7 @@ module Pod ...@@ -222,7 +222,7 @@ module Pod
describe "#compute_user_project_targets" do describe "#compute_user_project_targets" do
it "returns the targets specified in the target definition" do it "returns the targets specified in the target definition" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.link_with = ['UserTarget'] target_definition.link_with = ['UserTarget']
user_project = Xcodeproj::Project.new user_project = Xcodeproj::Project.new
user_project.new_target(:application, 'FirstTarget', :ios) user_project.new_target(:application, 'FirstTarget', :ios)
...@@ -233,7 +233,7 @@ module Pod ...@@ -233,7 +233,7 @@ module Pod
end end
it "raises if it is unable to find the targets specified by the target definition" do it "raises if it is unable to find the targets specified by the target definition" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.link_with = ['UserTarget'] target_definition.link_with = ['UserTarget']
user_project = Xcodeproj::Project.new user_project = Xcodeproj::Project.new
...@@ -242,7 +242,7 @@ module Pod ...@@ -242,7 +242,7 @@ module Pod
end end
it "returns the target with the same name of the target definition" do it "returns the target with the same name of the target definition" do
target_definition = Podfile::TargetDefinition.new('UserTarget', nil, nil) target_definition = Podfile::TargetDefinition.new('UserTarget', nil)
user_project = Xcodeproj::Project.new user_project = Xcodeproj::Project.new
user_project.new_target(:application, 'FirstTarget', :ios) user_project.new_target(:application, 'FirstTarget', :ios)
user_project.new_target(:application, 'UserTarget', :ios) user_project.new_target(:application, 'UserTarget', :ios)
...@@ -252,7 +252,7 @@ module Pod ...@@ -252,7 +252,7 @@ module Pod
end end
it "raises if the name of the target definition does not match any file" do it "raises if the name of the target definition does not match any file" do
target_definition = Podfile::TargetDefinition.new('UserTarget', nil, nil) target_definition = Podfile::TargetDefinition.new('UserTarget', nil)
user_project = Xcodeproj::Project.new user_project = Xcodeproj::Project.new
e = lambda { @analyzer.send(:compute_user_project_targets, target_definition, user_project) }.should.raise Informative e = lambda { @analyzer.send(:compute_user_project_targets, target_definition, user_project) }.should.raise Informative
...@@ -260,7 +260,7 @@ module Pod ...@@ -260,7 +260,7 @@ module Pod
end end
it "returns the first target of the project if the target definition is named default" do it "returns the first target of the project if the target definition is named default" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
user_project = Xcodeproj::Project.new user_project = Xcodeproj::Project.new
user_project.new_target(:application, 'FirstTarget', :ios) user_project.new_target(:application, 'FirstTarget', :ios)
user_project.new_target(:application, 'UserTarget', :ios) user_project.new_target(:application, 'UserTarget', :ios)
...@@ -270,7 +270,7 @@ module Pod ...@@ -270,7 +270,7 @@ module Pod
end end
it "raises if the default target definition cannot be linked because there are no user targets" do it "raises if the default target definition cannot be linked because there are no user targets" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
user_project = Xcodeproj::Project.new user_project = Xcodeproj::Project.new
e = lambda { @analyzer.send(:compute_user_project_targets, target_definition, user_project) }.should.raise Informative e = lambda { @analyzer.send(:compute_user_project_targets, target_definition, user_project) }.should.raise Informative
...@@ -290,7 +290,7 @@ module Pod ...@@ -290,7 +290,7 @@ module Pod
configuration.name = 'AppStore' configuration.name = 'AppStore'
target.build_configuration_list.build_configurations << configuration target.build_configuration_list.build_configurations << configuration
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
user_targets = [target] user_targets = [target]
configurations = @analyzer.send(:compute_user_build_configurations, target_definition, user_targets) configurations = @analyzer.send(:compute_user_build_configurations, target_definition, user_targets)
...@@ -299,7 +299,7 @@ module Pod ...@@ -299,7 +299,7 @@ module Pod
it "returns the user build configurations specified in the target definition" do it "returns the user build configurations specified in the target definition" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.build_configurations = { 'AppStore' => :release } target_definition.build_configurations = { 'AppStore' => :release }
user_targets = [] user_targets = []
...@@ -314,8 +314,8 @@ module Pod ...@@ -314,8 +314,8 @@ module Pod
describe "#compute_platform_for_target_definition" do describe "#compute_platform_for_target_definition" do
it "returns the platform specified in the target definition" do it "returns the platform specified in the target definition" do
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.platform = Platform.new(:ios, '4.0') target_definition.set_platform(:ios, '4.0')
user_targets = [] user_targets = []
configurations = @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets) configurations = @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets)
...@@ -331,7 +331,7 @@ module Pod ...@@ -331,7 +331,7 @@ module Pod
'IPHONEOS_DEPLOYMENT_TARGET' => '4.0' 'IPHONEOS_DEPLOYMENT_TARGET' => '4.0'
} }
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
user_targets = [target] user_targets = [target]
configurations = @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets) configurations = @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets)
...@@ -353,7 +353,7 @@ module Pod ...@@ -353,7 +353,7 @@ module Pod
'IPHONEOS_DEPLOYMENT_TARGET' => '6.0' 'IPHONEOS_DEPLOYMENT_TARGET' => '6.0'
} }
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
user_targets = [target1, target2] user_targets = [target1, target2]
configurations = @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets) configurations = @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets)
...@@ -375,7 +375,7 @@ module Pod ...@@ -375,7 +375,7 @@ module Pod
'IPHONEOS_DEPLOYMENT_TARGET' => '10.6' 'IPHONEOS_DEPLOYMENT_TARGET' => '10.6'
} }
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
user_targets = [target1, target2] user_targets = [target1, target2]
e = lambda { @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets) }.should.raise Informative e = lambda { @analyzer.send(:compute_platform_for_target_definition, target_definition, user_targets) }.should.raise Informative
e.message.should.match /Targets with different platforms/ e.message.should.match /Targets with different platforms/
......
...@@ -9,7 +9,7 @@ module Pod ...@@ -9,7 +9,7 @@ module Pod
sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject') sample_project_path = SpecHelper.create_sample_app_copy_from_fixture('SampleProject')
@sample_project = Xcodeproj::Project.new sample_project_path @sample_project = Xcodeproj::Project.new sample_project_path
@target = @sample_project.targets.first @target = @sample_project.targets.first
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
@lib = Library.new(target_definition) @lib = Library.new(target_definition)
@lib.user_project_path = sample_project_path @lib.user_project_path = sample_project_path
pods_project = Project.new() pods_project = Project.new()
......
...@@ -289,8 +289,8 @@ module Pod ...@@ -289,8 +289,8 @@ module Pod
it "install the targets of the Pod project" do it "install the targets of the Pod project" do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
target_definition.target_dependencies << Dependency.new('BananaLib') target_definition.store_pod('BananaLib')
library = Library.new(target_definition) library = Library.new(target_definition)
library.specs = [spec] library.specs = [spec]
@installer.stubs(:libraries).returns([library]) @installer.stubs(:libraries).returns([library])
...@@ -300,7 +300,7 @@ module Pod ...@@ -300,7 +300,7 @@ module Pod
it "skips empty libraries" do it "skips empty libraries" do
spec = fixture_spec('banana-lib/BananaLib.podspec') spec = fixture_spec('banana-lib/BananaLib.podspec')
target_definition = Podfile::TargetDefinition.new(:default, nil, nil) target_definition = Podfile::TargetDefinition.new(:default, nil)
library = Library.new(target_definition) library = Library.new(target_definition)
library.specs = [spec] library.specs = [spec]
@installer.stubs(:libraries).returns([library]) @installer.stubs(:libraries).returns([library])
......
...@@ -5,7 +5,7 @@ module Pod ...@@ -5,7 +5,7 @@ module Pod
describe "In general" do describe "In general" do
before do before do
@target_definition = Podfile::TargetDefinition.new(:default, nil, nil) @target_definition = Podfile::TargetDefinition.new(:default, nil)
@lib = Library.new(@target_definition) @lib = Library.new(@target_definition)
end end
...@@ -28,7 +28,7 @@ module Pod ...@@ -28,7 +28,7 @@ module Pod
describe "Support files" do describe "Support files" do
before do before do
@target_definition = Podfile::TargetDefinition.new(:default, nil, nil) @target_definition = Podfile::TargetDefinition.new(:default, nil)
@lib = Library.new(@target_definition) @lib = Library.new(@target_definition)
@lib.support_files_root = config.sandbox.root @lib.support_files_root = config.sandbox.root
@lib.user_project_path = config.sandbox.root + '../user_project.xcodeproj' @lib.user_project_path = config.sandbox.root + '../user_project.xcodeproj'
......
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