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
8062c2ba
Commit
8062c2ba
authored
May 08, 2015
by
Marius Rackwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Config] Allow to opt-out of target deduplication
parent
fcdc97c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
12 deletions
+30
-12
config.rb
lib/cocoapods/config.rb
+6
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+16
-12
config_spec.rb
spec/unit/config_spec.rb
+8
-0
No files found.
lib/cocoapods/config.rb
View file @
8062c2ba
...
@@ -19,6 +19,7 @@ module Pod
...
@@ -19,6 +19,7 @@ module Pod
:clean
=>
true
,
:clean
=>
true
,
:integrate_targets
=>
true
,
:integrate_targets
=>
true
,
:deduplicate_targets
=>
true
,
:lock_pod_source
=>
true
,
:lock_pod_source
=>
true
,
:new_version_message
=>
ENV
[
'COCOAPODS_SKIP_UPDATE_MESSAGE'
].
nil?
,
:new_version_message
=>
ENV
[
'COCOAPODS_SKIP_UPDATE_MESSAGE'
].
nil?
,
...
@@ -89,6 +90,11 @@ module Pod
...
@@ -89,6 +90,11 @@ module Pod
attr_accessor
:integrate_targets
attr_accessor
:integrate_targets
alias_method
:integrate_targets?
,
:integrate_targets
alias_method
:integrate_targets?
,
:integrate_targets
# @return [Bool] Whether CocoaPods should deduplicate pod targets.
#
attr_accessor
:deduplicate_targets
alias_method
:deduplicate_targets?
,
:deduplicate_targets
# @return [Bool] Whether the installer should skip the repos update.
# @return [Bool] Whether the installer should skip the repos update.
#
#
attr_accessor
:skip_repo_update
attr_accessor
:skip_repo_update
...
...
lib/cocoapods/installer/analyzer.rb
View file @
8062c2ba
...
@@ -284,20 +284,24 @@ module Pod
...
@@ -284,20 +284,24 @@ module Pod
def
generate_pod_targets
(
target
,
specs
,
pod_targets
)
def
generate_pod_targets
(
target
,
specs
,
pod_targets
)
grouped_specs
=
specs
.
group_by
(
&
:root
).
values
.
uniq
grouped_specs
=
specs
.
group_by
(
&
:root
).
values
.
uniq
grouped_specs
.
map
do
|
pod_specs
|
grouped_specs
.
map
do
|
pod_specs
|
# If there are no or already multiple pod targets with a common root,
if
config
.
deduplicate_targets?
# or the one which exists differs in the activated subspec set, then
# If there are no or already multiple pod targets with a common root,
# we need to generate another pod target
# or the one which exists differs in the activated subspec set, then
root_spec
=
pod_specs
.
first
.
root
# we need to generate another pod target
common_root_pod_targets
=
pod_targets
.
select
{
|
t
|
t
.
root_spec
==
root_spec
}
root_spec
=
pod_specs
.
first
.
root
if
common_root_pod_targets
.
count
!=
1
||
common_root_pod_targets
.
first
.
specs
!=
pod_specs
common_root_pod_targets
=
pod_targets
.
select
{
|
t
|
t
.
root_spec
==
root_spec
}
pod_target
=
generate_pod_target
(
target
,
pod_specs
)
if
common_root_pod_targets
.
count
!=
1
||
common_root_pod_targets
.
first
.
specs
!=
pod_specs
unless
common_root_pod_targets
.
empty?
pod_target
=
generate_pod_target
(
target
,
pod_specs
)
common_root_pod_targets
.
each
{
|
t
|
t
.
scoped
=
true
}
unless
common_root_pod_targets
.
empty?
pod_target
.
scoped
=
true
common_root_pod_targets
.
each
{
|
t
|
t
.
scoped
=
true
}
pod_target
.
scoped
=
true
end
pod_target
else
common_root_pod_targets
.
first
end
end
pod_target
else
else
common_root_pod_targets
.
first
generate_pod_target
(
target
,
pod_specs
).
scoped
end
end
end
end
end
end
...
...
spec/unit/config_spec.rb
View file @
8062c2ba
...
@@ -184,6 +184,14 @@ module Pod
...
@@ -184,6 +184,14 @@ module Pod
@config
.
should
.
lock_pod_source
@config
.
should
.
lock_pod_source
end
end
it
'integrates a user target'
do
@config
.
should
.
integrate_targets
end
it
'de-duplicates targets'
do
@config
.
should
.
deduplicate_targets
end
it
'returns the cache root'
do
it
'returns the cache root'
do
@config
.
cache_root
.
should
==
Pathname
.
new
(
File
.
join
(
ENV
[
'HOME'
],
'Library/Caches/CocoaPods'
))
@config
.
cache_root
.
should
==
Pathname
.
new
(
File
.
join
(
ENV
[
'HOME'
],
'Library/Caches/CocoaPods'
))
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