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
c17d5296
Commit
c17d5296
authored
Jan 30, 2016
by
Muhammed Yavuz Nuzumlali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analyzer] Unlock local dependencies if their specification changes
parent
1160056e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+7
-3
locking_dependency_analyzer.rb
...coapods/installer/analyzer/locking_dependency_analyzer.rb
+7
-1
No files found.
lib/cocoapods/installer/analyzer.rb
View file @
c17d5296
...
@@ -68,10 +68,11 @@ module Pod
...
@@ -68,10 +68,11 @@ module Pod
verify_platforms_specified!
verify_platforms_specified!
end
end
@result
.
podfile_state
=
generate_podfile_state
@result
.
podfile_state
=
generate_podfile_state
@locked_dependencies
=
generate_version_locking_dependencies
store_existing_checkout_options
store_existing_checkout_options
fetch_external_sources
if
allow_fetches
fetch_external_sources
if
allow_fetches
@locked_dependencies
=
generate_version_locking_dependencies
@result
.
specs_by_target
=
validate_platforms
(
resolve_dependencies
)
@result
.
specs_by_target
=
validate_platforms
(
resolve_dependencies
)
@result
.
specifications
=
generate_specifications
@result
.
specifications
=
generate_specifications
@result
.
targets
=
generate_targets
@result
.
targets
=
generate_targets
...
@@ -417,8 +418,11 @@ module Pod
...
@@ -417,8 +418,11 @@ module Pod
else
else
pods_to_update
=
result
.
podfile_state
.
changed
+
result
.
podfile_state
.
deleted
pods_to_update
=
result
.
podfile_state
.
changed
+
result
.
podfile_state
.
deleted
pods_to_update
+=
update
[
:pods
]
if
update_mode
==
:selected
pods_to_update
+=
update
[
:pods
]
if
update_mode
==
:selected
pods_to_update
+=
podfile
.
dependencies
.
select
(
&
:local?
).
map
(
&
:name
)
local_pod_names
=
podfile
.
dependencies
.
select
(
&
:local?
).
map
(
&
:root_name
)
LockingDependencyAnalyzer
.
generate_version_locking_dependencies
(
lockfile
,
pods_to_update
)
pods_to_unlock
=
local_pod_names
.
reject
do
|
pod_name
|
sandbox
.
specification
(
pod_name
).
checksum
==
lockfile
.
checksum
(
pod_name
)
end
LockingDependencyAnalyzer
.
generate_version_locking_dependencies
(
lockfile
,
pods_to_update
,
pods_to_unlock
)
end
end
end
end
...
...
lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb
View file @
c17d5296
...
@@ -6,6 +6,8 @@ module Pod
...
@@ -6,6 +6,8 @@ module Pod
# Generates dependencies that require the specific version of the Pods
# Generates dependencies that require the specific version of the Pods
# that haven't changed in the {Lockfile}.
# that haven't changed in the {Lockfile}.
module
LockingDependencyAnalyzer
module
LockingDependencyAnalyzer
class
<<
self
;
attr_accessor
:pods_to_unlock
;
end
# Generates dependencies that require the specific version of the Pods
# Generates dependencies that require the specific version of the Pods
# that haven't changed in the {Lockfile}.
# that haven't changed in the {Lockfile}.
#
#
...
@@ -17,7 +19,8 @@ module Pod
...
@@ -17,7 +19,8 @@ module Pod
# generated by the lockfile that prevent the resolver to update
# generated by the lockfile that prevent the resolver to update
# a Pod.
# a Pod.
#
#
def
self
.
generate_version_locking_dependencies
(
lockfile
,
pods_to_update
)
def
self
.
generate_version_locking_dependencies
(
lockfile
,
pods_to_update
,
pods_to_unlock
=
nil
)
self
.
pods_to_unlock
=
pods_to_unlock
dependency_graph
=
Molinillo
::
DependencyGraph
.
new
dependency_graph
=
Molinillo
::
DependencyGraph
.
new
if
lockfile
if
lockfile
...
@@ -58,6 +61,9 @@ module Pod
...
@@ -58,6 +61,9 @@ module Pod
def
self
.
add_child_vertex_to_graph
(
dependency_string
,
parents
,
dependency_graph
)
def
self
.
add_child_vertex_to_graph
(
dependency_string
,
parents
,
dependency_graph
)
dependency
=
Dependency
.
from_string
(
dependency_string
)
dependency
=
Dependency
.
from_string
(
dependency_string
)
if
self
.
pods_to_unlock
.
any?
{
|
name
|
dependency
.
root_name
==
name
}
dependency
=
Dependency
.
new
(
dependency
.
name
)
end
dependency_graph
.
add_child_vertex
(
dependency
.
name
,
parents
.
empty?
?
dependency
:
nil
,
parents
,
nil
)
dependency_graph
.
add_child_vertex
(
dependency
.
name
,
parents
.
empty?
?
dependency
:
nil
,
parents
,
nil
)
dependency
dependency
end
end
...
...
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