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
1711e76c
Commit
1711e76c
authored
Jan 29, 2016
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4825 from CocoaPods/seg-specs-state-root-name
[SpecsState] Ensure only root names are stored
parents
55b24295
24d29068
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
25 deletions
+38
-25
CHANGELOG.md
CHANGELOG.md
+5
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+3
-3
sandbox_analyzer.rb
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
+1
-1
specs_state.rb
lib/cocoapods/installer/analyzer/specs_state.rb
+21
-13
sandbox_analyzer_spec.rb
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
+2
-2
analyzer_spec.rb
spec/unit/installer/analyzer_spec.rb
+5
-5
installer_spec.rb
spec/unit/installer_spec.rb
+1
-1
No files found.
CHANGELOG.md
View file @
1711e76c
...
...
@@ -45,6 +45,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#4823
](
https://github.com/CocoaPods/CocoaPods/issues/4823
)
*
Determine whether an external source needs to be fetched when updating a
dependency regardless of subspec names.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#4821
](
https://github.com/CocoaPods/CocoaPods/issues/4821
)
## 1.0.0.beta.2 (2016-01-05)
...
...
lib/cocoapods/installer/analyzer.rb
View file @
1711e76c
...
...
@@ -202,7 +202,7 @@ module Pod
pods_state
else
state
=
SpecsState
.
new
state
.
added
.
concat
(
podfile
.
dependencies
.
map
(
&
:name
).
uniq
)
state
.
added
.
merge
(
podfile
.
dependencies
.
map
(
&
:root_name
)
)
state
end
end
...
...
@@ -477,8 +477,8 @@ module Pod
if
update_mode
==
:all
deps_to_fetch
=
deps_with_external_source
else
deps_to_fetch
=
deps_with_external_source
.
select
{
|
dep
|
pods_to_fetch
.
include?
(
dep
.
name
)
}
deps_to_fetch_if_needed
=
deps_with_external_source
.
select
{
|
dep
|
result
.
podfile_state
.
unchanged
.
include?
(
dep
.
name
)
}
deps_to_fetch
=
deps_with_external_source
.
select
{
|
dep
|
pods_to_fetch
.
include?
(
dep
.
root_
name
)
}
deps_to_fetch_if_needed
=
deps_with_external_source
.
select
{
|
dep
|
result
.
podfile_state
.
unchanged
.
include?
(
dep
.
root_
name
)
}
deps_to_fetch
+=
deps_to_fetch_if_needed
.
select
do
|
dep
|
sandbox
.
specification
(
dep
.
root_name
).
nil?
||
!
dep
.
external_source
[
:path
].
nil?
||
...
...
lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
View file @
1711e76c
...
...
@@ -78,7 +78,7 @@ module Pod
state
.
add_name
(
name
,
pod_state
(
name
))
end
else
state
.
added
.
concat
(
resolved_pods
)
state
.
added
.
merge
(
resolved_pods
)
end
state
end
...
...
lib/cocoapods/installer/analyzer/specs_state.rb
View file @
1711e76c
require
'set'
module
Pod
class
Installer
class
Analyzer
...
...
@@ -17,32 +19,38 @@ module Pod
# (`:added`, `:removed`, `:changed` or `:unchanged`).
#
def
initialize
(
pods_by_state
=
nil
)
@added
=
[]
@deleted
=
[]
@changed
=
[]
@unchanged
=
[]
@added
=
Set
.
new
@deleted
=
Set
.
new
@changed
=
Set
.
new
@unchanged
=
Set
.
new
if
pods_by_state
@added
=
pods_by_state
[
:added
]
||
[]
@deleted
=
pods_by_state
[
:removed
]
||
[]
@changed
=
pods_by_state
[
:changed
]
||
[]
@unchanged
=
pods_by_state
[
:unchanged
]
||
[]
{
:added
=>
:added
,
:changed
=>
:changed
,
:removed
=>
:deleted
,
:unchanged
=>
:unchanged
,
}.
each
do
|
state
,
spec_state
|
Array
(
pods_by_state
[
state
]).
each
do
|
name
|
add_name
(
name
,
spec_state
)
end
end
end
end
# @return [
Array
<String>] the names of the pods that were added.
# @return [
Set
<String>] the names of the pods that were added.
#
attr_accessor
:added
# @return [
Array
<String>] the names of the pods that were changed.
# @return [
Set
<String>] the names of the pods that were changed.
#
attr_accessor
:changed
# @return [
Array
<String>] the names of the pods that were deleted.
# @return [
Set
<String>] the names of the pods that were deleted.
#
attr_accessor
:deleted
# @return [
Array
<String>] the names of the pods that were unchanged.
# @return [
Set
<String>] the names of the pods that were unchanged.
#
attr_accessor
:unchanged
...
...
@@ -68,7 +76,7 @@ module Pod
# @return [void]
#
def
add_name
(
name
,
state
)
send
(
state
)
<<
name
send
(
state
)
<<
Specification
.
root_name
(
name
)
end
end
end
...
...
spec/unit/installer/analyzer/sandbox_analyzer_spec.rb
View file @
1711e76c
...
...
@@ -22,12 +22,12 @@ module Pod
@analyzer
.
stubs
(
:sandbox_checksum
).
returns
(
@spec
.
checksum
)
state
=
@analyzer
.
analyze
state
.
class
.
should
==
Installer
::
Analyzer
::
SpecsState
state
.
unchanged
.
should
==
[
'BananaLib'
]
state
.
unchanged
.
should
==
Set
.
new
(
%w(BananaLib)
)
end
it
'marks all the pods as added if no sandbox manifest is available'
do
@sandbox
.
stubs
(
:manifest
)
@analyzer
.
analyze
.
added
.
should
==
[
'BananaLib'
]
@analyzer
.
analyze
.
added
.
should
==
Set
.
new
(
%w(BananaLib)
)
end
end
...
...
spec/unit/installer/analyzer_spec.rb
View file @
1711e76c
...
...
@@ -52,10 +52,10 @@ module Pod
it
'computes the state of the Podfile respect to the Lockfile'
do
state
=
@analyzer
.
analyze
.
podfile_state
state
.
added
.
should
==
%w(AFNetworking libextobjc/EXTKeyPathCoding libextobjc/EXTSynthesize
)
state
.
changed
.
should
==
%w(
)
state
.
unchanged
.
should
==
%w(JSONKit SVPullToRefresh
)
state
.
deleted
.
should
==
%w(NUI
)
state
.
added
.
should
==
Set
.
new
(
%w(AFNetworking libextobjc libextobjc)
)
state
.
changed
.
should
==
Set
.
new
(
%w()
)
state
.
unchanged
.
should
==
Set
.
new
(
%w(JSONKit SVPullToRefresh)
)
state
.
deleted
.
should
==
Set
.
new
(
%w(NUI)
)
end
#--------------------------------------#
...
...
@@ -437,7 +437,7 @@ module Pod
it
'does not download the same source multiple times for different subspecs'
do
podfile_state
=
Installer
::
Analyzer
::
SpecsState
.
new
podfile_state
.
added
<<
'ARAnalytics
/Mixpanel'
<<
'ARAnalytics/HockeyApp
'
podfile_state
.
added
<<
'ARAnalytics'
@analyzer
.
stubs
(
:result
).
returns
(
stub
(
:podfile_state
=>
podfile_state
))
@podfile
.
stubs
(
:dependencies
).
returns
([
Dependency
.
new
(
'ARAnalytics/Mixpanel'
,
:git
=>
'https://github.com/orta/ARAnalytics'
,
:commit
=>
'6f1a1c314894437e7e5c09572c276e644dbfb64b'
),
...
...
spec/unit/installer_spec.rb
View file @
1711e76c
...
...
@@ -396,7 +396,7 @@ module Pod
it
'analyzes the Podfile, the Lockfile and the Sandbox'
do
@installer
.
send
(
:analyze
)
@installer
.
analysis_result
.
sandbox_state
.
added
.
should
==
[
'JSONKit'
]
@installer
.
analysis_result
.
sandbox_state
.
added
.
should
==
Set
.
new
(
%w(JSONKit)
)
end
it
'stores the targets created by the analyzer'
do
...
...
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