Commit 844946c4 authored by Antoine d'Otreppe's avatar Antoine d'Otreppe Committed by Lasse Bang Mikkelsen

Added support for pre-download over SVN (fixes #524)

parent c261fe98
...@@ -136,6 +136,8 @@ module Pod ...@@ -136,6 +136,8 @@ module Pod
return unless name && params return unless name && params
if params.key?(:git) if params.key?(:git)
GitSource.new(name, params) GitSource.new(name, params)
elsif params.key?(:svn)
SvnSource.new(name, params)
elsif params.key?(:podspec) elsif params.key?(:podspec)
PodspecSource.new(name, params) PodspecSource.new(name, params)
elsif params.key?(:local) elsif params.key?(:local)
...@@ -214,6 +216,32 @@ module Pod ...@@ -214,6 +216,32 @@ module Pod
end end
end end
class SvnSource < AbstractExternalSource
# FIXME svn may complain that it cannot validate the certificate.
# In that case, do a first svn export by yourself,
# and accept the certificate permanently
def copy_external_source_into_sandbox(sandbox, platform)
puts "-> Pre-downloading: '#{name}'" unless config.silent?
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")
if local_pod = sandbox.installed_pod_named(name, platform)
local_pod.downloaded = true
end
end
def description
"from `#{@params[:svn]}'".tap do |description|
# TODO is the :folder param meaningful here ?
description << ", folder `#{@params[:folder]}'" if @params[:revision]
description << ", tag `#{@params[:tag]}'" if @params[:tag]
description << ", revision `#{@params[:revision]}'" if @params[:revision]
end
end
end
# can be http, file, etc # can be http, file, etc
class PodspecSource < AbstractExternalSource class PodspecSource < AbstractExternalSource
def copy_external_source_into_sandbox(sandbox, _) def copy_external_source_into_sandbox(sandbox, _)
......
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