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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
config.rb
lib/cocoapods/config.rb
+6
-0
analyzer.rb
lib/cocoapods/installer/analyzer.rb
+4
-0
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,6 +284,7 @@ module Pod
...
@@ -284,6 +284,7 @@ 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
config
.
deduplicate_targets?
# If there are no or already multiple pod targets with a common root,
# If there are no or already multiple pod targets with a common root,
# or the one which exists differs in the activated subspec set, then
# or the one which exists differs in the activated subspec set, then
# we need to generate another pod target
# we need to generate another pod target
...
@@ -299,6 +300,9 @@ module Pod
...
@@ -299,6 +300,9 @@ module Pod
else
else
common_root_pod_targets
.
first
common_root_pod_targets
.
first
end
end
else
generate_pod_target
(
target
,
pod_specs
).
scoped
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