Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
bc2473ea
Commit
bc2473ea
authored
Dec 04, 2012
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #672 from lassebm/podfile-svn-pre-download
Subversion pre-download support
parents
c261fe98
5f12ff7c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
4 deletions
+60
-4
dependency.rb
lib/cocoapods/dependency.rb
+25
-0
subversion.rb
lib/cocoapods/downloader/subversion.rb
+6
-2
current
spec/fixtures/subversion-repo/db/current
+1
-1
rep-cache.db
spec/fixtures/subversion-repo/db/rep-cache.db
+0
-0
12
spec/fixtures/subversion-repo/db/revprops/0/12
+14
-0
12
spec/fixtures/subversion-repo/db/revs/0/12
+0
-0
txn-current
spec/fixtures/subversion-repo/db/txn-current
+1
-1
dependency_spec.rb
spec/unit/dependency_spec.rb
+13
-0
No files found.
lib/cocoapods/dependency.rb
View file @
bc2473ea
...
@@ -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,29 @@ module Pod
...
@@ -214,6 +216,29 @@ module Pod
end
end
end
end
class
SvnSource
<
AbstractExternalSource
def
copy_external_source_into_sandbox
(
sandbox
,
platform
)
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"
)
if
local_pod
=
sandbox
.
installed_pod_named
(
name
,
platform
)
local_pod
.
downloaded
=
true
end
end
end
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
# 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
,
_
)
...
...
lib/cocoapods/downloader/subversion.rb
View file @
bc2473ea
...
@@ -9,16 +9,20 @@ module Pod
...
@@ -9,16 +9,20 @@ module Pod
def
download
def
download
UI
.
section
(
' > Exporting subversion repo'
,
''
,
3
)
do
UI
.
section
(
' > Exporting subversion repo'
,
''
,
3
)
do
svn!
%|
export
"#{reference_url}" "#{target_path}"|
svn!
%|
#{export_subcommand}
"#{reference_url}" "#{target_path}"|
end
end
end
end
def
download_head
def
download_head
UI
.
section
(
' > Exporting subversion repo'
,
''
,
3
)
do
UI
.
section
(
' > Exporting subversion repo'
,
''
,
3
)
do
svn!
%|
export
"#{trunk_url}" "#{target_path}"|
svn!
%|
#{export_subcommand}
"#{trunk_url}" "#{target_path}"|
end
end
end
end
def
export_subcommand
result
=
'export --non-interactive --trust-server-cert'
end
def
reference_url
def
reference_url
result
=
url
.
dup
result
=
url
.
dup
result
<<
'/'
<<
options
[
:folder
]
if
options
[
:folder
]
result
<<
'/'
<<
options
[
:folder
]
if
options
[
:folder
]
...
...
spec/fixtures/subversion-repo/db/current
View file @
bc2473ea
1
1
1
2
spec/fixtures/subversion-repo/db/rep-cache.db
View file @
bc2473ea
No preview for this file type
spec/fixtures/subversion-repo/db/revprops/0/12
0 → 100644
View file @
bc2473ea
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
spec/fixtures/subversion-repo/db/revs/0/12
0 → 100644
View file @
bc2473ea
File added
spec/fixtures/subversion-repo/db/txn-current
View file @
bc2473ea
b
e
spec/unit/dependency_spec.rb
View file @
bc2473ea
...
@@ -106,6 +106,19 @@ module Pod
...
@@ -106,6 +106,19 @@ module Pod
path
.
should
.
exist?
path
.
should
.
exist?
end
end
it
"marks a LocalPod as downloaded if it's from SvnSource"
do
dependency
=
Dependency
.
new
(
"SvnSource"
,
:svn
=>
"file://
#{
fixture
(
'subversion-repo/trunk'
)
}
"
)
dependency
.
external_source
.
copy_external_source_into_sandbox
(
@sandbox
,
Platform
.
ios
)
@sandbox
.
installed_pod_named
(
'SvnSource'
,
Platform
.
ios
).
downloaded
.
should
.
be
.
true
end
it
"creates a copy of the podspec (SvnSource)"
do
dependency
=
Dependency
.
new
(
"SvnSource"
,
:svn
=>
"file://
#{
fixture
(
'subversion-repo/trunk'
)
}
"
)
dependency
.
external_source
.
copy_external_source_into_sandbox
(
@sandbox
,
Platform
.
ios
)
path
=
@sandbox
.
root
+
'Local Podspecs/SvnSource.podspec'
path
.
should
.
exist?
end
it
"creates a copy of the podspec (PodspecSource)"
do
it
"creates a copy of the podspec (PodspecSource)"
do
dependency
=
Dependency
.
new
(
"Reachability"
,
:podspec
=>
fixture
(
'integration/Reachability/Reachability.podspec'
).
to_s
)
dependency
=
Dependency
.
new
(
"Reachability"
,
:podspec
=>
fixture
(
'integration/Reachability/Reachability.podspec'
).
to_s
)
dependency
.
external_source
.
copy_external_source_into_sandbox
(
@sandbox
,
Platform
.
ios
)
dependency
.
external_source
.
copy_external_source_into_sandbox
(
@sandbox
,
Platform
.
ios
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment