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
f2697f98
Commit
f2697f98
authored
Feb 14, 2015
by
Samuel E. Giddins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Installer] Automatically detect conflicts between framework names.
parent
a6b6ea04
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
installer.rb
lib/cocoapods/installer.rb
+15
-0
installer_spec.rb
spec/unit/installer_spec.rb
+23
-0
No files found.
CHANGELOG.md
View file @
f2697f98
...
@@ -19,6 +19,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -19,6 +19,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[
Kyle Fuller
](
https://github.com/kylef
)
[
Kyle Fuller
](
https://github.com/kylef
)
[
#2996
](
https://github.com/CocoaPods/CocoaPods/issues/2996
)
[
#2996
](
https://github.com/CocoaPods/CocoaPods/issues/2996
)
*
Automatically detect conflicts between framework names.
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#2943
](
https://github.com/CocoaPods/CocoaPods/issues/2943
)
##### Bug Fixes
##### Bug Fixes
*
Fixed installation for app-extension targets which had no dependencies
*
Fixed installation for app-extension targets which had no dependencies
...
...
lib/cocoapods/installer.rb
View file @
f2697f98
...
@@ -90,6 +90,7 @@ module Pod
...
@@ -90,6 +90,7 @@ module Pod
resolve_dependencies
resolve_dependencies
download_dependencies
download_dependencies
determine_dependency_product_types
determine_dependency_product_types
verify_no_duplicate_framework_names
generate_pods_project
generate_pods_project
integrate_user_project
if
config
.
integrate_targets?
integrate_user_project
if
config
.
integrate_targets?
perform_post_install_actions
perform_post_install_actions
...
@@ -327,6 +328,20 @@ module Pod
...
@@ -327,6 +328,20 @@ module Pod
end
end
end
end
def
verify_no_duplicate_framework_names
aggregate_targets
.
each
do
|
aggregate_target
|
aggregate_target
.
user_build_configurations
.
keys
.
each
do
|
config
|
pod_targets
=
aggregate_target
.
pod_targets_for_build_configuration
(
config
)
vendored_frameworks
=
pod_targets
.
flat_map
(
&
:file_accessors
).
flat_map
(
&
:vendored_frameworks
)
frameworks
=
vendored_frameworks
.
map
{
|
fw
|
fw
.
basename
(
'.framework'
)
}
frameworks
+=
pod_targets
.
select
{
|
pt
|
pt
.
should_build?
&&
pt
.
requires_frameworks?
}.
map
(
&
:product_module_name
)
duplicates
=
frameworks
.
group_by
{
|
f
|
f
}.
select
{
|
_
,
v
|
v
.
size
>
1
}.
keys
raise
"The '
#{
aggregate_target
.
label
}
' target has frameworks with conflicting names:
#{
duplicates
.
to_sentence
}
."
unless
duplicates
.
empty?
end
end
end
# Performs any post-installation actions
# Performs any post-installation actions
#
#
# @return [void]
# @return [void]
...
...
spec/unit/installer_spec.rb
View file @
f2697f98
...
@@ -49,6 +49,7 @@ module Pod
...
@@ -49,6 +49,7 @@ module Pod
@installer
.
stubs
(
:resolve_dependencies
)
@installer
.
stubs
(
:resolve_dependencies
)
@installer
.
stubs
(
:download_dependencies
)
@installer
.
stubs
(
:download_dependencies
)
@installer
.
stubs
(
:determine_dependency_product_types
)
@installer
.
stubs
(
:determine_dependency_product_types
)
@installer
.
stubs
(
:verify_no_duplicate_framework_names
)
@installer
.
stubs
(
:generate_pods_project
)
@installer
.
stubs
(
:generate_pods_project
)
@installer
.
stubs
(
:integrate_user_project
)
@installer
.
stubs
(
:integrate_user_project
)
@installer
.
stubs
(
:run_plugins_post_install_hooks
)
@installer
.
stubs
(
:run_plugins_post_install_hooks
)
...
@@ -144,6 +145,28 @@ module Pod
...
@@ -144,6 +145,28 @@ module Pod
#-------------------------------------------------------------------------#
#-------------------------------------------------------------------------#
describe
'#verify_no_duplicate_framework_names'
do
it
'detects duplicate framework names'
do
Sandbox
::
FileAccessor
.
any_instance
.
stubs
(
:vendored_frameworks
).
returns
([
Pathname
(
'monkey.framework'
)])
fixture_path
=
ROOT
+
'spec/fixtures'
config
.
repos_dir
=
fixture_path
+
'spec-repos'
podfile
=
Pod
::
Podfile
.
new
do
platform
:ios
,
'8.0'
xcodeproj
'SampleProject/SampleProject'
pod
'BananaLib'
,
:path
=>
(
fixture_path
+
'banana-lib'
).
to_s
pod
'OrangeFramework'
,
:path
=>
(
fixture_path
+
'orange-framework'
).
to_s
pod
'monkey'
,
:path
=>
(
fixture_path
+
'monkey'
).
to_s
end
lockfile
=
generate_lockfile
config
.
integrate_targets
=
false
@installer
=
Installer
.
new
(
config
.
sandbox
,
podfile
,
lockfile
)
should
.
raise
{
@installer
.
install!
}.
message
.
should
.
match
/conflict.*monkey/
end
end
#-------------------------------------------------------------------------#
describe
'Dependencies Resolution'
do
describe
'Dependencies Resolution'
do
describe
'#analyze'
do
describe
'#analyze'
do
it
'prints a warning if the version of the Lockfile is higher than the one of the executable'
do
it
'prints a warning if the version of the Lockfile is higher than the one of the executable'
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