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
e45d24e2
Commit
e45d24e2
authored
May 22, 2013
by
Fabio Pelosin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Sandbox] Store list of pods in head mode
Closes #1046 Closes #1039
parent
9577c6d3
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
77 additions
and
20 deletions
+77
-20
CHANGELOG.md
CHANGELOG.md
+3
-0
sandbox_analyzer.rb
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
+1
-1
pod_source_installer.rb
lib/cocoapods/installer/pod_source_installer.rb
+5
-1
resolver.rb
lib/cocoapods/resolver.rb
+4
-1
sandbox.rb
lib/cocoapods/sandbox.rb
+34
-1
sandbox_analyzer_spec.rb
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
+2
-2
pod_source_installer_spec.rb
spec/unit/installer/pod_source_installer_spec.rb
+2
-2
resolver_spec.rb
spec/unit/resolver_spec.rb
+2
-0
sandbox_spec.rb
spec/unit/sandbox_spec.rb
+24
-12
No files found.
CHANGELOG.md
View file @
e45d24e2
...
@@ -68,6 +68,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
...
@@ -68,6 +68,9 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
*
Fix copy resources script for iOS < 6 and OS X < 10.8 by removing the
*
Fix copy resources script for iOS < 6 and OS X < 10.8 by removing the
`--reference-external-strings-file`
`--reference-external-strings-file`
flag.
[
#1030
](
https://github.com/CocoaPods/CocoaPods/pull/1030
)
flag.
[
#1030
](
https://github.com/CocoaPods/CocoaPods/pull/1030
)
*
Fixed issues with the
`:head`
option of the Podfile.
[
#1046
](
https://github.com/CocoaPods/CocoaPods/issues/1046
)
[
#1039
](
https://github.com/CocoaPods/CocoaPods/issues/1039
)
## 0.19.1
## 0.19.1
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.19.0...0.19.1
)
[
CocoaPods
](
https://github.com/CocoaPods/CocoaPods/compare/0.19.0...0.19.1
)
...
...
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
View file @
e45d24e2
...
@@ -151,7 +151,7 @@ module Pod
...
@@ -151,7 +151,7 @@ module Pod
return
true
if
sandbox
.
predownloaded?
(
pod
)
return
true
if
sandbox
.
predownloaded?
(
pod
)
return
true
if
folder_empty?
(
pod
)
return
true
if
folder_empty?
(
pod
)
if
update_mode
if
update_mode
return
true
if
s
pec
.
version
.
head?
return
true
if
s
andbox
.
head_pod?
(
pod
)
end
end
return
false
return
false
end
end
...
...
lib/cocoapods/installer/pod_source_installer.rb
View file @
e45d24e2
...
@@ -91,7 +91,7 @@ module Pod
...
@@ -91,7 +91,7 @@ module Pod
#
#
def
download_source
def
download_source
root
.
rmtree
if
root
.
exist?
root
.
rmtree
if
root
.
exist?
if
root_spec
.
version
.
hea
d?
if
head_po
d?
downloader
.
download_head
downloader
.
download_head
@specific_source
=
downloader
.
checkout_options
@specific_source
=
downloader
.
checkout_options
else
else
...
@@ -172,6 +172,10 @@ module Pod
...
@@ -172,6 +172,10 @@ module Pod
sandbox
.
local?
(
root_spec
.
name
)
sandbox
.
local?
(
root_spec
.
name
)
end
end
def
head_pod?
sandbox
.
head_pod?
(
root_spec
.
name
)
end
#-----------------------------------------------------------------------#
#-----------------------------------------------------------------------#
private
private
...
...
lib/cocoapods/resolver.rb
View file @
e45d24e2
...
@@ -158,7 +158,10 @@ module Pod
...
@@ -158,7 +158,10 @@ module Pod
@loaded_specs
<<
spec
.
name
@loaded_specs
<<
spec
.
name
cached_specs
[
spec
.
name
]
=
spec
cached_specs
[
spec
.
name
]
=
spec
validate_platform
(
spec
,
target_definition
)
validate_platform
(
spec
,
target_definition
)
spec
.
version
.
head
=
dependency
.
head?
if
dependency
.
head?
||
sandbox
.
head_pod?
(
spec
.
name
)
spec
.
version
.
head
=
true
sandbox
.
store_head_pod
(
spec
.
name
)
end
spec_dependencies
=
spec
.
all_dependencies
(
target_definition
.
platform
)
spec_dependencies
=
spec
.
all_dependencies
(
target_definition
.
platform
)
find_dependency_specs
(
spec
,
spec_dependencies
,
target_definition
)
find_dependency_specs
(
spec
,
spec_dependencies
,
target_definition
)
...
...
lib/cocoapods/sandbox.rb
View file @
e45d24e2
...
@@ -70,6 +70,7 @@ module Pod
...
@@ -70,6 +70,7 @@ module Pod
@build_headers
=
HeadersStore
.
new
(
self
,
"BuildHeaders"
)
@build_headers
=
HeadersStore
.
new
(
self
,
"BuildHeaders"
)
@public_headers
=
HeadersStore
.
new
(
self
,
"Headers"
)
@public_headers
=
HeadersStore
.
new
(
self
,
"Headers"
)
@predownloaded_pods
=
[]
@predownloaded_pods
=
[]
@head_pods
=
[]
@checkout_sources
=
{}
@checkout_sources
=
{}
@local_pods
=
{}
@local_pods
=
{}
FileUtils
.
mkdir_p
(
@root
)
FileUtils
.
mkdir_p
(
@root
)
...
@@ -94,8 +95,9 @@ module Pod
...
@@ -94,8 +95,9 @@ module Pod
root
.
rmtree
root
.
rmtree
end
end
# Removes the files of the Pod with the given name from the sandbox.
#
#
#
#
@return [void]
#
#
def
clean_pod
(
name
)
def
clean_pod
(
name
)
root_name
=
Specification
.
root_name
(
name
)
root_name
=
Specification
.
root_name
(
name
)
...
@@ -279,6 +281,37 @@ module Pod
...
@@ -279,6 +281,37 @@ module Pod
#--------------------------------------#
#--------------------------------------#
# Marks a Pod as head.
#
# @param [String] name
# The name of the Pod.
#
# @return [void]
#
def
store_head_pod
(
name
)
root_name
=
Specification
.
root_name
(
name
)
head_pods
<<
root_name
end
# @return [Array<String>] The names of the pods that have been
# marked as head.
#
attr_reader
:head_pods
# Checks if a Pod should attempt to use the head source of the git repo.
#
# @param [String] name
# The name of the Pod.
#
# @return [Bool] Whether the Pod has been marked as head.
#
def
head_pod?
(
name
)
root_name
=
Specification
.
root_name
(
name
)
head_pods
.
include?
(
root_name
)
end
#--------------------------------------#
# Stores the local path of a Pod.
# Stores the local path of a Pod.
#
#
# @param [String] name
# @param [String] name
...
...
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
View file @
e45d24e2
...
@@ -89,13 +89,13 @@ module Pod
...
@@ -89,13 +89,13 @@ module Pod
end
end
it
"considers changed a Pod whose specification is in head mode if in update mode"
do
it
"considers changed a Pod whose specification is in head mode if in update mode"
do
@s
pec
.
version
.
head
=
true
@s
andbox
.
stubs
(
:head_pod?
).
returns
(
true
)
@analyzer
.
stubs
(
:update_mode
).
returns
(
true
)
@analyzer
.
stubs
(
:update_mode
).
returns
(
true
)
@analyzer
.
send
(
:pod_changed?
,
'BananaLib'
).
should
==
true
@analyzer
.
send
(
:pod_changed?
,
'BananaLib'
).
should
==
true
end
end
it
"doesn't consider changed a Pod whose specification is in head mode if not in update mode"
do
it
"doesn't consider changed a Pod whose specification is in head mode if not in update mode"
do
@s
pec
.
version
.
head
=
true
@s
andbox
.
stubs
(
:head_pod?
).
returns
(
true
)
@analyzer
.
stubs
(
:update_mode
).
returns
(
false
)
@analyzer
.
stubs
(
:update_mode
).
returns
(
false
)
@analyzer
.
send
(
:pod_changed?
,
'BananaLib'
).
should
==
false
@analyzer
.
send
(
:pod_changed?
,
'BananaLib'
).
should
==
false
end
end
...
...
spec/unit/installer/pod_source_installer_spec.rb
View file @
e45d24e2
...
@@ -34,7 +34,7 @@ module Pod
...
@@ -34,7 +34,7 @@ module Pod
end
end
it
"downloads the head source if specified source"
do
it
"downloads the head source if specified source"
do
@spec
.
version
.
head
=
true
config
.
sandbox
.
store_head_pod
(
'BananaLib'
)
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
@installer
.
install!
@installer
.
install!
@installer
.
specific_source
[
:commit
].
should
==
"0b8b4084a43c38cfe308efa076fdeb3a64d9d2bc"
@installer
.
specific_source
[
:commit
].
should
==
"0b8b4084a43c38cfe308efa076fdeb3a64d9d2bc"
...
@@ -51,7 +51,7 @@ module Pod
...
@@ -51,7 +51,7 @@ module Pod
end
end
it
"stores the checkout options in the sandbox"
do
it
"stores the checkout options in the sandbox"
do
@spec
.
version
.
head
=
true
config
.
sandbox
.
store_head_pod
(
'BananaLib'
)
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
@spec
.
source
=
{
:git
=>
SpecHelper
.
fixture
(
'banana-lib'
),
:tag
=>
'v1.0'
}
@installer
.
install!
@installer
.
install!
sources
=
@installer
.
sandbox
.
checkout_sources
sources
=
@installer
.
sandbox
.
checkout_sources
...
...
spec/unit/resolver_spec.rb
View file @
e45d24e2
...
@@ -161,6 +161,8 @@ module Pod
...
@@ -161,6 +161,8 @@ module Pod
filemd5hash
,
jsonkit
=
resolver
.
resolve
.
values
.
first
.
sort_by
(
&
:name
)
filemd5hash
,
jsonkit
=
resolver
.
resolve
.
values
.
first
.
sort_by
(
&
:name
)
filemd5hash
.
version
.
should
.
not
.
be
.
head
filemd5hash
.
version
.
should
.
not
.
be
.
head
jsonkit
.
version
.
should
.
be
.
head
jsonkit
.
version
.
should
.
be
.
head
config
.
sandbox
.
head_pod?
(
'FileMD5Hash'
).
should
.
be
.
false
config
.
sandbox
.
head_pod?
(
'JSONKit'
).
should
.
be
.
true
end
end
it
"raises if it finds two conflicting dependencies"
do
it
"raises if it finds two conflicting dependencies"
do
...
...
spec/unit/sandbox_spec.rb
View file @
e45d24e2
...
@@ -76,6 +76,11 @@ module Pod
...
@@ -76,6 +76,11 @@ module Pod
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
temporary_directory
+
'Sandbox/JSONKit'
@sandbox
.
pod_dir
(
'JSONKit'
).
should
==
temporary_directory
+
'Sandbox/JSONKit'
end
end
it
"returns the directory where a local Pod is stored"
do
@sandbox
.
store_local_path
(
'BananaLib'
,
Pathname
.
new
(
'Some Path'
))
@sandbox
.
pod_dir
(
'BananaLib'
).
should
.
be
==
Pathname
.
new
(
'Some Path'
)
end
it
"returns the directory where to store the documentation"
do
it
"returns the directory where to store the documentation"
do
@sandbox
.
documentation_dir
.
should
==
temporary_directory
+
'Sandbox/Documentation'
@sandbox
.
documentation_dir
.
should
==
temporary_directory
+
'Sandbox/Documentation'
end
end
...
@@ -122,23 +127,11 @@ module Pod
...
@@ -122,23 +127,11 @@ module Pod
describe
"Pods information"
do
describe
"Pods information"
do
it
"returns the directory where a local Pod is stored"
do
@sandbox
.
store_local_path
(
'BananaLib'
,
Pathname
.
new
(
'Some Path'
))
@sandbox
.
pod_dir
(
'BananaLib'
).
should
.
be
==
Pathname
.
new
(
'Some Path'
)
end
#--------------------------------------#
it
"stores the list of the names of the pre-downloaded pods"
do
it
"stores the list of the names of the pre-downloaded pods"
do
@sandbox
.
store_pre_downloaded_pod
(
'BananaLib'
)
@sandbox
.
store_pre_downloaded_pod
(
'BananaLib'
)
@sandbox
.
predownloaded_pods
.
should
==
[
'BananaLib'
]
@sandbox
.
predownloaded_pods
.
should
==
[
'BananaLib'
]
end
end
it
"returns the checkout sources of the Pods"
do
@sandbox
.
store_pre_downloaded_pod
(
'BananaLib/Subspec'
)
@sandbox
.
predownloaded_pods
.
should
==
[
'BananaLib'
]
end
it
"returns whether a Pod has been pre-downloaded"
do
it
"returns whether a Pod has been pre-downloaded"
do
@sandbox
.
predownloaded_pods
<<
'BananaLib'
@sandbox
.
predownloaded_pods
<<
'BananaLib'
@sandbox
.
predownloaded?
(
'BananaLib'
).
should
.
be
.
true
@sandbox
.
predownloaded?
(
'BananaLib'
).
should
.
be
.
true
...
@@ -148,6 +141,25 @@ module Pod
...
@@ -148,6 +141,25 @@ module Pod
#--------------------------------------#
#--------------------------------------#
it
"stores the list of the names of the pre-downloaded pods"
do
@sandbox
.
store_head_pod
(
'BananaLib'
)
@sandbox
.
head_pods
.
should
==
[
'BananaLib'
]
end
it
"returns whether a Pod has been pre-downloaded"
do
@sandbox
.
head_pods
<<
'BananaLib'
@sandbox
.
head_pod?
(
'BananaLib'
).
should
.
be
.
true
@sandbox
.
head_pod?
(
'BananaLib/Subspec'
).
should
.
be
.
true
@sandbox
.
head_pod?
(
'Monkey'
).
should
.
be
.
false
end
#--------------------------------------#
it
"returns the checkout sources of the Pods"
do
@sandbox
.
store_pre_downloaded_pod
(
'BananaLib/Subspec'
)
@sandbox
.
predownloaded_pods
.
should
==
[
'BananaLib'
]
end
it
"stores the checkout source of a Pod"
do
it
"stores the checkout source of a Pod"
do
source
=
{
:git
=>
'example.com'
,
:commit
=>
'SHA'
}
source
=
{
:git
=>
'example.com'
,
:commit
=>
'SHA'
}
@sandbox
.
store_checkout_source
(
'BananaLib/Subspec'
,
source
)
@sandbox
.
store_checkout_source
(
'BananaLib/Subspec'
,
source
)
...
...
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