Commit 8bdb41f8 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'master' into spec-refactor

* master:
  Minor copy change
  A few small fixes related to integrating multiple targets/projects.
  Add rake ~> 0.9.0 (for rake/file_list.rb file) to gemspec. Closes #195.
  Fix for https://github.com/CocoaPods/CocoaPods/issues/141
  [Push] Bypass pre-commit hook.
  [Fix] GitHub downloader was downloading the repos twice.

Conflicts:
	spec/unit/resolver_spec.rb
parents ebc4b151 326928c7
......@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'xcodeproj', '~> 0.1.0'
s.add_runtime_dependency 'colored', '~> 1.2'
s.add_runtime_dependency 'escape', '~> 0.0.4'
s.add_runtime_dependency 'rake', '~> 0.9.0'
s.add_development_dependency 'bacon', '~> 1.1'
## Make sure you can build the gem on older versions of RubyGems too:
......
......@@ -25,7 +25,7 @@ module Pod
def self.options
[
["--no-clean", "Leave SCM dirs like `.git' and `.svn' in tact after downloading"],
["--no-clean", "Leave SCM dirs like `.git' and `.svn' intact after downloading"],
["--no-doc", "Skip documentation generation with appledoc"],
["--force-doc", "Force the generation of documentation"],
["--no-integrate", "Skip integration of the Pods libraries in the Xcode project(s)"],
......
......@@ -92,7 +92,8 @@ module Pod
FileUtils.cp(Pathname.new(spec.name+'.podspec'), output_path)
Dir.chdir(repo_dir) do
git("add #{spec.name}")
git("commit -m '#{message}'")
# Bypass the pre-commit hook because we already performed validation
git("commit --no-verify -m '#{message}'")
end
end
end
......
......@@ -17,7 +17,7 @@ module Pod
elsif !name_and_version_requirements.empty? && block.nil?
if name_and_version_requirements.last.is_a?(Hash)
@external_source = ExternalSources.from_params(name_and_version_requirements[0], name_and_version_requirements.pop)
@external_source = ExternalSources.from_params(name_and_version_requirements[0].split('/').first, name_and_version_requirements.pop)
end
super(*name_and_version_requirements)
......
......@@ -123,12 +123,10 @@ module Pod
end
def download_tag
super unless download_only?
download_only? ? download_and_extract_tarball(options[:tag]) : super
end
def download_commit
super unless download_only?
download_only? ? download_and_extract_tarball(options[:commit]) : super
end
......
......@@ -35,7 +35,11 @@ module Pod
end
def user_project_paths
@podfile.target_definitions.values.map { |td| td.user_project.path }
@podfile.target_definitions.values.map do |td|
next if td.empty?
td.user_project.path #|| raise(Informative, "Could not resolve the Xcode project in which the " \
# "`#{td.name}' target should be integrated.")
end.compact
end
def create_workspace!
......
......@@ -79,7 +79,7 @@ module Pod
end
def platform
@platform || @parent.platform
@platform || (@parent.platform if @parent)
end
def label
......
......@@ -42,7 +42,11 @@ module Pod
# that's being used behind the scenes, but passing it anyways for
# completeness sake.
specification = external_source.specification_from_sandbox(@sandbox, platform)
Specification::Set::External.new(specification)
set = Specification::Set::External.new(specification)
if dependency.subspec_dependency?
@cached_sets[dependency.top_level_spec_name] ||= set
end
set
else
@cached_sources.search(dependency)
end
......
......@@ -26,6 +26,14 @@ describe "Pod::Podfile" do
dep.external_source.params.should == { :git => 'GIT-URL', :commit => '1234' }
end
it "adds a subspec dependency on a Pod repo outside of a spec repo (the repo is expected to contain a podspec)" do
podfile = Pod::Podfile.new do
dependency 'MainSpec/FirstSubSpec', :git => 'GIT-URL', :commit => '1234'
end
dep = podfile.dependency_by_top_level_spec_name('MainSpec')
dep.external_source.name.should == 'MainSpec'
end
it "adds a dependency on a library outside of a spec repo (the repo does not need to contain a podspec)" do
podfile = Pod::Podfile.new do
dependency 'SomeExternalPod', :podspec => 'http://gist/SomeExternalPod.podspec'
......
......@@ -155,6 +155,31 @@ describe "Pod::Resolver" do
RestKit/ObjectMapping/JSON
RestKit/UI
}
it "resolves subspecs with external constraints" do
@podfile = Pod::Podfile.new do
platform :ios
dependency 'MainSpec/FirstSubSpec', :git => 'GIT-URL'
end
spec = Pod::Spec.new do |s|
s.name = 'MainSpec'
s.version = '1.2.3'
s.platform = :ios
s.license = 'MIT'
s.author = 'Joe the Plumber'
s.summary = 'A spec with subspecs'
s.source = { :git => '/some/url' }
s.requires_arc = true
s.subspec 'FirstSubSpec' do |fss|
fss.source_files = 'some/file'
fss.subspec 'SecondSubSpec'
end
end
@podfile.dependencies.first.external_source.stubs(:specification_from_sandbox).returns(spec)
resolver = Pod::Resolver.new(@podfile, stub('sandbox'))
resolver.resolve.values.flatten.map(&:name).sort.should == %w{ MainSpec/FirstSubSpec MainSpec/FirstSubSpec/SecondSubSpec }
end
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