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
235022c9
Commit
235022c9
authored
Jul 19, 2017
by
Dimitris Koutsogiorgas
Committed by
GitHub
Jul 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6877 from abiligiri/duplicate_frameworks
Remove duplicate framework names
parents
5f39a708
142b70bd
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
3 deletions
+34
-3
CHANGELOG.md
CHANGELOG.md
+4
-0
target_validator.rb
lib/cocoapods/installer/xcode/target_validator.rb
+1
-1
target_validator_spec.rb
spec/unit/installer/xcode/target_validator_spec.rb
+29
-2
No files found.
CHANGELOG.md
View file @
235022c9
...
...
@@ -43,6 +43,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
David Airapetyan
](
https://github.com/davidair
)
[
#4887
](
https://github.com/CocoaPods/CocoaPods/issues/4887
)
*
Select unique module_name(s) across host target's and embedded targets' pod targets
[
Anand Biligiri
](
https://github.com/abiligiri
)
[
#6711
](
https://github.com/CocoaPods/CocoaPods/issues/6711
)
## 1.3.0.beta.2 (2017-06-22)
##### Enhancements
...
...
lib/cocoapods/installer/xcode/target_validator.rb
View file @
235022c9
...
...
@@ -47,7 +47,7 @@ module Pod
file_accessors
=
pod_targets
.
flat_map
(
&
:file_accessors
)
frameworks
=
file_accessors
.
flat_map
(
&
:vendored_frameworks
).
uniq
.
map
(
&
:basename
)
frameworks
+=
pod_targets
.
select
{
|
pt
|
pt
.
should_build?
&&
pt
.
requires_frameworks?
}.
map
(
&
:product_module_name
)
frameworks
+=
pod_targets
.
select
{
|
pt
|
pt
.
should_build?
&&
pt
.
requires_frameworks?
}.
map
(
&
:product_module_name
)
.
uniq
verify_no_duplicate_names
(
frameworks
,
aggregate_target
.
label
,
'frameworks'
)
libraries
=
file_accessors
.
flat_map
(
&
:vendored_libraries
).
uniq
.
map
(
&
:basename
)
...
...
spec/unit/installer/xcode/target_validator_spec.rb
View file @
235022c9
...
...
@@ -17,9 +17,9 @@ module Pod
# @return [AnalysisResult]
#
def
create_validator
(
sandbox
,
podfile
,
lockfile
)
def
create_validator
(
sandbox
,
podfile
,
lockfile
,
integrate_targets
=
false
)
installation_options
=
Installer
::
InstallationOptions
.
new
.
tap
do
|
options
|
options
.
integrate_targets
=
false
options
.
integrate_targets
=
integrate_targets
end
@analyzer
=
Analyzer
.
new
(
config
.
sandbox
,
podfile
,
lockfile
).
tap
do
|
analyzer
|
...
...
@@ -35,6 +35,10 @@ module Pod
end
describe
'#verify_no_duplicate_framework_and_library_names'
do
before
do
SpecHelper
.
create_sample_app_copy_from_fixture
(
'Sample Extensions Project'
)
end
it
'detects duplicate library names'
do
Sandbox
::
FileAccessor
.
any_instance
.
stubs
(
:vendored_libraries
).
returns
([
Pathname
(
'a/libBananalib.a'
)])
Pod
::
Specification
.
any_instance
.
stubs
(
:dependencies
).
returns
([])
...
...
@@ -92,6 +96,29 @@ module Pod
@validator
=
create_validator
(
config
.
sandbox
,
podfile
,
lockfile
)
should
.
not
.
raise
(
Informative
)
{
@validator
.
validate!
}
end
it
'including multiple subspecs from the same pod in a target does not result in duplicate frameworks'
do
fixture_path
=
ROOT
+
'spec/fixtures'
config
.
repos_dir
=
fixture_path
+
'spec-repos'
podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
,
'9.3'
project
'Sample Extensions Project/Sample Extensions Project'
use_frameworks!
target
'Sample Extensions Project'
do
pod
'matryoshka/Foo'
,
:path
=>
(
fixture_path
+
'matryoshka'
).
to_s
pod
'matryoshka'
,
:path
=>
(
fixture_path
+
'matryoshka'
).
to_s
end
target
'Today Extension'
do
pod
'matryoshka/Foo'
,
:path
=>
(
fixture_path
+
'matryoshka'
).
to_s
end
end
lockfile
=
generate_lockfile
@validator
=
create_validator
(
config
.
sandbox
,
podfile
,
lockfile
,
true
)
should
.
not
.
raise
(
Informative
)
{
@validator
.
validate!
}
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