Commit 6854a011 authored by Eloy Duran's avatar Eloy Duran

Bye bye config.rootspec.

parent 9afec2a3
...@@ -35,7 +35,7 @@ module Pod ...@@ -35,7 +35,7 @@ module Pod
end end
def run def run
unless podfile = config.rootspec unless podfile = config.podfile
raise Informative, "No `Podfile' found in the current working directory." raise Informative, "No `Podfile' found in the current working directory."
end end
if @projpath && !File.exist?(@projpath) if @projpath && !File.exist?(@projpath)
......
...@@ -10,7 +10,7 @@ module Pod ...@@ -10,7 +10,7 @@ module Pod
@instance = instance @instance = instance
end end
attr_accessor :repos_dir, :project_root, :project_pods_root, :rootspec, :clean, :verbose, :silent, :doc, :doc_install, :force_doc attr_accessor :repos_dir, :project_root, :project_pods_root, :clean, :verbose, :silent, :doc, :doc_install, :force_doc
alias_method :clean?, :clean alias_method :clean?, :clean
alias_method :verbose?, :verbose alias_method :verbose?, :verbose
alias_method :silent?, :silent alias_method :silent?, :silent
...@@ -45,8 +45,8 @@ module Pod ...@@ -45,8 +45,8 @@ module Pod
end end
# Returns the spec at the pat returned from `project_podfile`. # Returns the spec at the pat returned from `project_podfile`.
def rootspec def podfile
@rootspec ||= begin @podfile ||= begin
Podfile.from_file(project_podfile) if project_podfile.exist? Podfile.from_file(project_podfile) if project_podfile.exist?
end end
end end
...@@ -55,14 +55,14 @@ module Pod ...@@ -55,14 +55,14 @@ module Pod
require 'colored' require 'colored'
caller.find { |line| line =~ /^(.+.podspec):\d*/ } caller.find { |line| line =~ /^(.+.podspec):\d*/ }
puts "[!] The use of `config.ios?` is deprecated and will be removed in version 0.7.#{" Called from: #{$1}" if $1}".red puts "[!] The use of `config.ios?` is deprecated and will be removed in version 0.7.#{" Called from: #{$1}" if $1}".red
rootspec.target_definitions[:default].platform == :ios if rootspec podfile.target_definitions[:default].platform == :ios if podfile
end end
def osx? def osx?
require 'colored' require 'colored'
caller.find { |line| line =~ /^(.+.podspec):\d*/ } caller.find { |line| line =~ /^(.+.podspec):\d*/ }
puts "[!] The use of `config.ios?` is deprecated and will be removed in version 0.7.#{" Called from: #{$1}" if $1}".red puts "[!] The use of `config.ios?` is deprecated and will be removed in version 0.7.#{" Called from: #{$1}" if $1}".red
rootspec.target_definitions[:default].platform == :osx if rootspec podfile.target_definitions[:default].platform == :osx if podfile
end end
module Mixin module Mixin
......
...@@ -201,7 +201,6 @@ else ...@@ -201,7 +201,6 @@ else
it "runs the optional post_install callback defined in the Podfile _before_ the project is saved to disk" do it "runs the optional post_install callback defined in the Podfile _before_ the project is saved to disk" do
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
config.rootspec = self
self.platform platform self.platform platform
dependency 'SSZipArchive' dependency 'SSZipArchive'
...@@ -223,9 +222,6 @@ else ...@@ -223,9 +222,6 @@ else
# TODO add a simple source file which uses the compiled lib to check that it really really works # TODO add a simple source file which uses the compiled lib to check that it really really works
it "activates required pods and create a working static library xcode project" do it "activates required pods and create a working static library xcode project" do
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform self.platform platform
dependency 'Reachability', '> 2.0.5' if platform == :ios dependency 'Reachability', '> 2.0.5' if platform == :ios
dependency 'ASIWebPageRequest', '>= 1.8.1' dependency 'ASIWebPageRequest', '>= 1.8.1'
...@@ -270,9 +266,6 @@ else ...@@ -270,9 +266,6 @@ else
if platform == :ios if platform == :ios
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::Podfile.new do spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform self.platform platform
dependency 'Reachability', '2.0.4' # only 2.0.4 is part of ASIHTTPRequest’s source. dependency 'Reachability', '2.0.4' # only 2.0.4 is part of ASIHTTPRequest’s source.
end end
...@@ -290,9 +283,6 @@ else ...@@ -290,9 +283,6 @@ else
it "adds resources to the xcode copy script" do it "adds resources to the xcode copy script" do
spec = Pod::Podfile.new do spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform self.platform platform
dependency 'SSZipArchive' dependency 'SSZipArchive'
end end
...@@ -310,9 +300,6 @@ else ...@@ -310,9 +300,6 @@ else
# TODO we need to do more cleaning and/or add a --prune task # TODO we need to do more cleaning and/or add a --prune task
it "overwrites an existing project.pbxproj file" do it "overwrites an existing project.pbxproj file" do
spec = Pod::Podfile.new do spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform self.platform platform
dependency 'JSONKit' dependency 'JSONKit'
end end
...@@ -320,9 +307,6 @@ else ...@@ -320,9 +307,6 @@ else
installer.install! installer.install!
spec = Pod::Podfile.new do spec = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform self.platform platform
dependency 'SSZipArchive' dependency 'SSZipArchive'
end end
...@@ -335,8 +319,6 @@ else ...@@ -335,8 +319,6 @@ else
it "creates a project with multiple targets" do it "creates a project with multiple targets" do
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform self.platform platform
target(:debug) { dependency 'SSZipArchive' } target(:debug) { dependency 'SSZipArchive' }
target(:test, :exclusive => true) { dependency 'JSONKit' } target(:test, :exclusive => true) { dependency 'JSONKit' }
...@@ -409,8 +391,6 @@ else ...@@ -409,8 +391,6 @@ else
it "should prevent duplication cleaning headers symlinks with multiple targets" do it "should prevent duplication cleaning headers symlinks with multiple targets" do
podfile = Pod::Podfile.new do podfile = Pod::Podfile.new do
# first ensure that the correct info is available to the specs when they load
config.rootspec = self
self.platform platform self.platform platform
target(:debug) { dependency 'SSZipArchive' } target(:debug) { dependency 'SSZipArchive' }
target(:test, :exclusive => true) { dependency 'JSONKit' } target(:test, :exclusive => true) { dependency 'JSONKit' }
......
...@@ -35,7 +35,6 @@ describe "Pod::Installer" do ...@@ -35,7 +35,6 @@ describe "Pod::Installer" do
platform :osx platform :osx
dependency 'ASIHTTPRequest' dependency 'ASIHTTPRequest'
end end
config.rootspec = podfile
installer = Pod::Installer.new(podfile) installer = Pod::Installer.new(podfile)
pods = installer.activated_specifications.map do |spec| pods = installer.activated_specifications.map do |spec|
Pod::LocalPod.new(spec, installer.sandbox, podfile.target_definitions[:default].platform) Pod::LocalPod.new(spec, installer.sandbox, podfile.target_definitions[:default].platform)
...@@ -52,7 +51,6 @@ describe "Pod::Installer" do ...@@ -52,7 +51,6 @@ describe "Pod::Installer" do
dependency 'JSONKit' dependency 'JSONKit'
end end
end end
config.rootspec = podfile
installer = Pod::Installer.new(podfile) installer = Pod::Installer.new(podfile)
installer.target_installers.map(&:target_definition).map(&:name).should == [:not_empty] installer.target_installers.map(&:target_definition).map(&:name).should == [:not_empty]
end end
......
...@@ -10,7 +10,6 @@ describe "Pod::Resolver" do ...@@ -10,7 +10,6 @@ describe "Pod::Resolver" do
platform :ios platform :ios
dependency 'ASIWebPageRequest' dependency 'ASIWebPageRequest'
end end
config.rootspec = @podfile
@resolver = Pod::Resolver.new(@podfile, stub('sandbox')) @resolver = Pod::Resolver.new(@podfile, stub('sandbox'))
end end
...@@ -66,7 +65,6 @@ describe "Pod::Resolver" do ...@@ -66,7 +65,6 @@ describe "Pod::Resolver" do
dependency 'RestKit/Network' dependency 'RestKit/Network'
dependency 'RestKit/ObjectMapping' dependency 'RestKit/ObjectMapping'
end end
config.rootspec = @podfile
resolver = Pod::Resolver.new(@podfile, stub('sandbox')) resolver = Pod::Resolver.new(@podfile, stub('sandbox'))
resolver.resolve.values.flatten.map(&:name).sort.should == %w{ resolver.resolve.values.flatten.map(&:name).sort.should == %w{
LibComponentLogging-Core LibComponentLogging-Core
......
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