Commit 96039683 authored by Fabio Pelosin's avatar Fabio Pelosin

Merge branch 'master' into 0.17

* master:
  Added tests for Subversion dependencies
  Forced non-interactive and trust server certificate
  Updated to latest output mechanism
  Added SvnSource podspec to Subversion fixture repo
  Fixed a little mistake in the svn pre-download description
  Added support for pre-download over SVN (fixes #524)
  Tiny docs fix to reflect being able to handle either spelling of Licen{c,s}e

Conflicts:
	lib/cocoapods/dependency.rb
	spec/unit/dependency_spec.rb
parents aab6e51b bc2473ea
GIT
remote: git://github.com/CocoaPods/Core.git
revision: 7d81fe67e641634c26d19b25c424058d6b7c5526
revision: c9baef99f8526a3d8f81a5b312e7b5a81b04a1f6
specs:
cocoapods-core (0.17.0.alpha)
activesupport (~> 3.2.6)
......
......@@ -13,13 +13,13 @@ Pod::Spec.new do |s|
# s.description = <<-DESC
# An optional longer description of Example.podspec
#
# * Markdonw format.
# * Markdown format.
# * Don't worry about the indent, we strip it!
# DESC
s.homepage = "http://EXAMPLE/Example.podspec"
# Specify the license type. CocoaPods detects automatically the license file if it is named
# `LICENSE*.*', however if the name is different, specify it.
# `LICEN{C,S}E*.*', however if the name is different, specify it.
s.license = 'MIT (example)'
# s.license = { :type => 'MIT (example)', :file => 'FILE_LICENSE' }
#
......
......@@ -272,7 +272,7 @@ Pod::Spec.new do |s|
s.homepage = "#{data[:homepage]}"
# Specify the license type. CocoaPods detects automatically the license file if it is named
# `LICENSE*.*', however if the name is different, specify it.
# `LICEN{C,S}E*.*', however if the name is different, specify it.
s.license = 'MIT (example)'
# s.license = { :type => 'MIT (example)', :file => 'FILE_LICENSE' }
#
......
......@@ -9,16 +9,20 @@ module Pod
def download
UI.section(' > Exporting subversion repo', '', 3) do
svn! %|export "#{reference_url}" "#{target_path}"|
svn! %|#{export_subcommand} "#{reference_url}" "#{target_path}"|
end
end
def download_head
UI.section(' > Exporting subversion repo', '', 3) do
svn! %|export "#{trunk_url}" "#{target_path}"|
svn! %|#{export_subcommand} "#{trunk_url}" "#{target_path}"|
end
end
def export_subcommand
result = 'export --non-interactive --trust-server-cert'
end
def reference_url
result = url.dup
result << '/' << options[:folder] if options[:folder]
......
......@@ -14,6 +14,7 @@ module Pod
params = dependency.external_source
klass = if params.key?(:git) then GitSource
elsif params.key?(:svn) then SvnSource
elsif params.key?(:podspec) then PodspecSource
elsif params.key?(:local) then LocalSource
end
......@@ -150,6 +151,7 @@ module Pod
#-------------------------------------------------------------------------#
# Provides support for fetching a specification file from a Git remote.
#
# Supports all the options of the downloader (is similar to the git key of
# `source` attribute of a specification).
#
......@@ -188,6 +190,47 @@ module Pod
#-------------------------------------------------------------------------#
# Provides support for fetching a specification file from a SvnSource
# remote.
#
# Supports all the options of the downloader (is similar to the git key of
# `source` attribute of a specification).
#
# @note The podspec must be in the root of the repository and should have a
# name matching the one of the dependency.
#
class SvnSource < AbstractExternalSource
# @see AbstractExternalSource#copy_external_source_into_sandbox
#
# @note To prevent a double download of the repository the pod is marked
# as pre-downloaded indicating to the installer that only clean
# operations are needed.
#
def copy_external_source_into_sandbox(sandbox)
UI.info("->".green + " Pre-downloading: '#{name}'") do
target = sandbox.root + name
target.rmtree if target.exist?
downloader = Downloader.for_target(sandbox.root + name, @params)
downloader.download
store_podspec(sandbox, target + "#{name}.podspec")
sandbox.predownloaded_pods << name
end
end
# @see AbstractExternalSource#description
#
def description
"from `#{@params[:svn]}'".tap do |description|
description << ", folder `#{@params[:folder]}'" if @params[:folder]
description << ", tag `#{@params[:tag]}'" if @params[:tag]
description << ", revision `#{@params[:revision]}'" if @params[:revision]
end
end
end
#-------------------------------------------------------------------------#
# Provides support for fetching a specification file from an URL. Can be
# http, file, etc.
#
......
K 10
svn:author
V 3
lbm
K 8
svn:date
V 27
2012-12-03T12:33:18.707618Z
K 7
svn:log
V 24
Added SvnSource podspec
END
......@@ -41,6 +41,27 @@ module Pod
xit "returns the description" do end
end
describe ExternalSources::SvnSource do
it "creates a copy of the podspec" do
dependency = Dependency.new("SvnSource", :svn => "file://#{fixture('subversion-repo/trunk')}")
external_source = ExternalSources.from_dependency(dependency)
external_source.copy_external_source_into_sandbox(config.sandbox)
path = config.sandbox.root + 'Local Podspecs/SvnSource.podspec'
path.should.exist?
end
it "marks a LocalPod as downloaded" do
dependency = Dependency.new("SvnSource", :svn => "file://#{fixture('subversion-repo/trunk')}")
external_source = ExternalSources.from_dependency(dependency)
external_source.copy_external_source_into_sandbox(config.sandbox)
config.sandbox.predownloaded_pods.should == ["SvnSource"]
end
xit "returns the description" do end
end
describe ExternalSources::PodspecSource do
it "creates a copy of the podspec" do
dependency = Dependency.new("Reachability", :podspec => fixture('integration/Reachability/Reachability.podspec').to_s)
......
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