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
06bab6d9
Commit
06bab6d9
authored
Oct 24, 2014
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Analyzer] Use specific checkout options from lockfile
parent
9ca5e278
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
23 deletions
+47
-23
Gemfile.lock
Gemfile.lock
+2
-2
external_sources.rb
lib/cocoapods/external_sources.rb
+4
-2
installer.rb
lib/cocoapods/installer.rb
+1
-1
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+38
-17
project_spec.rb
spec/functional/command/project_spec.rb
+2
-1
No files found.
Gemfile.lock
View file @
06bab6d9
GIT
remote: https://github.com/CocoaPods/Core.git
revision:
60a486e8141323390dc5ff7f6676cf893a251a48
branch:
master
revision:
854ff482bc9d41b1acebbaae2fc6c67204a08d0f
branch:
lockfile-checkout-options
specs:
cocoapods-core (0.35.0.rc2)
activesupport (>= 3.2.15)
...
...
lib/cocoapods/external_sources.rb
View file @
06bab6d9
...
...
@@ -13,9 +13,11 @@ module Pod
# hash.
#
def
self
.
from_dependency
(
dependency
,
podfile_path
)
name
=
dependency
.
root_name
params
=
dependency
.
external_source
from_params
(
dependency
.
external_source
,
dependency
,
podfile_path
)
end
def
self
.
from_params
(
params
,
dependency
,
podfile_path
)
name
=
dependency
.
root_name
if
klass
=
concrete_class_from_params
(
params
)
klass
.
new
(
name
,
params
,
podfile_path
)
else
...
...
lib/cocoapods/installer.rb
View file @
06bab6d9
...
...
@@ -466,7 +466,7 @@ module Pod
#
def
write_lockfiles
# checkout_options = sandbox.checkout_options
@lockfile
=
Lockfile
.
generate
(
podfile
,
analysis_result
.
specifications
)
@lockfile
=
Lockfile
.
generate
(
podfile
,
analysis_result
.
specifications
,
sandbox
.
checkout_sources
)
UI
.
message
"- Writing Lockfile in
#{
UI
.
path
config
.
lockfile_path
}
"
do
@lockfile
.
write_to_disk
(
config
.
lockfile_path
)
...
...
lib/cocoapods/installer/analyzer.rb
View file @
06bab6d9
...
...
@@ -264,34 +264,55 @@ module Pod
#
def
fetch_external_sources
return
unless
allow_pre_downloads?
deps_to_fetch
=
[]
deps_to_fetch_if_needed
=
[]
deps_with_external_source
=
podfile
.
dependencies
.
select
(
&
:external_source
)
deps_with_different_sources
=
podfile
.
dependencies
.
group_by
(
&
:root_name
).
select
{
|
_root_name
,
dependencies
|
dependencies
.
map
(
&
:external_source
).
uniq
.
count
>
1
}
deps_with_different_sources
.
each
do
|
root_name
,
dependencies
|
raise
Informative
,
"There are multiple dependencies with different sources for `
#{
root_name
}
` in
#{
UI
.
path
podfile
.
defined_in_file
}
:
\n\n
-
#{
dependencies
.
map
(
&
:to_s
).
join
(
"
\n
- "
)
}
"
end
if
update_mode
==
:all
deps_to_fetch
=
deps_with_external_source
unless
dependencies_to_fetch
.
empty?
UI
.
section
'Fetching external sources'
do
dependencies_to_fetch
.
sort
.
each
do
|
dependency
|
fetch_external_source
(
dependency
,
!
pods_to_fetch
.
include?
(
dependency
.
name
))
end
end
end
end
def
fetch_external_source
(
dependency
,
use_lockfile_options
)
checkout_options
=
lockfile
.
checkout_options_for_pod_named
(
dependency
.
root_name
)
if
lockfile
if
checkout_options
&&
use_lockfile_options
source
=
ExternalSources
.
from_params
(
checkout_options
,
dependency
,
podfile
.
defined_in_file
)
else
pods_to_fetch
=
result
.
podfile_state
.
added
+
result
.
podfile_state
.
changed
if
update_mode
==
:selected
pods_to_fetch
+=
update
[
:pods
]
source
=
ExternalSources
.
from_dependency
(
dependency
,
podfile
.
defined_in_file
)
end
source
.
fetch
(
sandbox
)
end
def
dependencies_to_fetch
@deps_to_fetch
||=
begin
deps_to_fetch
=
[]
deps_to_fetch_if_needed
=
[]
deps_with_external_source
=
podfile
.
dependencies
.
select
(
&
:external_source
)
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_to_fetch_if_needed
.
select
{
|
dep
|
sandbox
.
specification
(
dep
.
name
).
nil?
||
!
dep
.
external_source
[
:local
].
nil?
||
!
dep
.
external_source
[
:path
].
nil?
||
!
sandbox
.
pod_dir
(
dep
.
name
).
directory?
}
end
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_to_fetch_if_needed
.
select
{
|
dep
|
sandbox
.
specification
(
dep
.
name
).
nil?
||
!
dep
.
external_source
[
:local
].
nil?
||
!
dep
.
external_source
[
:path
].
nil?
||
!
sandbox
.
pod_dir
(
dep
.
name
).
directory?
}
deps_to_fetch
.
uniq
(
&
:root_name
)
end
end
unless
deps_to_fetch
.
empty?
UI
.
section
'Fetching external sources'
do
deps_to_fetch
.
uniq
(
&
:root_name
).
sort
.
each
do
|
dependency
|
source
=
ExternalSources
.
from_dependency
(
dependency
,
podfile
.
defined_in_file
)
source
.
fetch
(
sandbox
)
end
def
pods_to_fetch
@pods_to_fetch
||=
begin
pods_to_fetch
=
result
.
podfile_state
.
added
+
result
.
podfile_state
.
changed
if
update_mode
==
:selected
pods_to_fetch
+=
update
[
:pods
]
end
pods_to_fetch
end
end
...
...
spec/functional/command/project_spec.rb
View file @
06bab6d9
...
...
@@ -63,7 +63,8 @@ module Pod
s
.
version
=
'1.0'
end
,
]
Lockfile
.
generate
(
podfile
,
specs
).
write_to_disk
(
temporary_directory
+
'Podfile.lock'
)
external_sources
=
{}
Lockfile
.
generate
(
podfile
,
specs
,
external_sources
).
write_to_disk
(
temporary_directory
+
'Podfile.lock'
)
end
it
'for a single missing Pod'
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