Commit 1139295f authored by Eloy Duran's avatar Eloy Duran

Actually build the generated static library project in the integration spec.

parent d3f97469
...@@ -41,7 +41,7 @@ module Pod ...@@ -41,7 +41,7 @@ module Pod
raise Help, "No Podfile found in current working directory." raise Help, "No Podfile found in current working directory."
end end
end end
Installer.new(spec, config.project_pods_root).install! Installer.new(spec).install!
end end
end end
end end
......
...@@ -4,8 +4,8 @@ module Pod ...@@ -4,8 +4,8 @@ module Pod
class Installer class Installer
include Config::Mixin include Config::Mixin
def initialize(top_level_specification, pods_root) def initialize(top_level_specification)
@top_level_specification, @pods_root = top_level_specification, pods_root @top_level_specification = top_level_specification
end end
def dependent_specification_sets def dependent_specification_sets
...@@ -55,7 +55,7 @@ module Pod ...@@ -55,7 +55,7 @@ module Pod
pattern = pattern + '*.{h,m,mm,c,cpp}' if pattern.directory? pattern = pattern + '*.{h,m,mm,c,cpp}' if pattern.directory?
Dir.glob(pattern.to_s).each do |file| Dir.glob(pattern.to_s).each do |file|
file = Pathname.new(file) file = Pathname.new(file)
file = file.relative_path_from(@pods_root) file = file.relative_path_from(config.project_pods_root)
xproj.add_source_file(file) xproj.add_source_file(file)
end end
end end
...@@ -64,8 +64,8 @@ module Pod ...@@ -64,8 +64,8 @@ module Pod
end end
def write_files! def write_files!
xproj.create_in(@pods_root) xproj.create_in(config.project_pods_root)
xcconfig.create_in(@pods_root) xcconfig.create_in(config.project_pods_root)
end end
end end
end end
...@@ -31,7 +31,7 @@ else ...@@ -31,7 +31,7 @@ else
Pod::Source.reset! Pod::Source.reset!
Pod::Spec::Set.reset! Pod::Spec::Set.reset!
fixture('spec-repos/master') # ensure the archive is unpacked fixture('spec-repos/master') # ensure the archive is unpacked
config.project_pods_root = SpecHelper.temporary_directory + 'Pods' config.project_pods_root = temporary_directory + 'Pods'
config.repos_dir = fixture('spec-repos') config.repos_dir = fixture('spec-repos')
end end
...@@ -40,27 +40,36 @@ else ...@@ -40,27 +40,36 @@ else
config.repos_dir = SpecHelper.tmp_repos_path config.repos_dir = SpecHelper.tmp_repos_path
end end
it "should work" do it "should activate required pods and create a working static library xcode project" do
spec = Pod::Spec.new do spec = Pod::Spec.new do
dependency 'ASIWebPageRequest', '< 1.8.1' dependency 'ASIWebPageRequest', '< 1.8.1'
dependency 'JSONKit', '>= 1.0' dependency 'JSONKit', '>= 1.0'
dependency 'SSZipArchive', '< 2' dependency 'SSZipArchive', '< 2'
end end
installer = SpecHelper::Installer.new(spec, SpecHelper.temporary_directory)
installer = SpecHelper::Installer.new(spec)
installer.install! installer.install!
(config.project_pods_root + 'Reachability.podspec').should.exist (config.project_pods_root + 'Reachability.podspec').should.exist
(config.project_pods_root + 'ASIHTTPRequest.podspec').should.exist (config.project_pods_root + 'ASIHTTPRequest.podspec').should.exist
(config.project_pods_root + 'ASIWebPageRequest.podspec').should.exist (config.project_pods_root + 'ASIWebPageRequest.podspec').should.exist
(config.project_pods_root + 'JSONKit.podspec').should.exist (config.project_pods_root + 'JSONKit.podspec').should.exist
(config.project_pods_root + 'SSZipArchive.podspec').should.exist (config.project_pods_root + 'SSZipArchive.podspec').should.exist
puts "\n[!] Compiling static library..."
Dir.chdir(config.project_pods_root) do
system("xcodebuild > /dev/null 2>&1").should == true
end
end end
it "does not activate pods that are only part of other pods" do it "does not activate pods that are only part of other pods" do
spec = Pod::Spec.new do spec = Pod::Spec.new do
dependency 'Reachability' dependency 'Reachability'
end end
installer = SpecHelper::Installer.new(spec, SpecHelper.temporary_directory)
installer = SpecHelper::Installer.new(spec)
installer.install! installer.install!
(config.project_pods_root + 'Reachability.podspec').should.exist (config.project_pods_root + 'Reachability.podspec').should.exist
(config.project_pods_root + 'ASIHTTPRequest.podspec').should.not.exist (config.project_pods_root + 'ASIHTTPRequest.podspec').should.not.exist
end end
......
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