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
2183a670
Commit
2183a670
authored
Aug 10, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wire dependencies for pod targets not part of any aggregate target
parent
0cdb66a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
3 deletions
+42
-3
CHANGELOG.md
CHANGELOG.md
+3
-2
pods_project_generator.rb
lib/cocoapods/installer/xcode/pods_project_generator.rb
+18
-1
pods_project_generator_spec.rb
spec/unit/installer/xcode/pods_project_generator_spec.rb
+21
-0
No files found.
CHANGELOG.md
View file @
2183a670
...
@@ -18,8 +18,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -18,8 +18,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
None.
*
Wire dependencies for pod targets not part of any aggregate target
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#6948
](
https://github.com/CocoaPods/CocoaPods/pull/6948
)
## 1.3.1 (2017-08-02)
## 1.3.1 (2017-08-02)
...
...
lib/cocoapods/installer/xcode/pods_project_generator.rb
View file @
2183a670
...
@@ -208,12 +208,14 @@ module Pod
...
@@ -208,12 +208,14 @@ module Pod
#
#
def
set_target_dependencies
def
set_target_dependencies
frameworks_group
=
project
.
frameworks_group
frameworks_group
=
project
.
frameworks_group
test_only_pod_targets
=
pod_targets
.
dup
aggregate_targets
.
each
do
|
aggregate_target
|
aggregate_targets
.
each
do
|
aggregate_target
|
is_app_extension
=
!
(
aggregate_target
.
user_targets
.
map
(
&
:symbol_type
)
&
is_app_extension
=
!
(
aggregate_target
.
user_targets
.
map
(
&
:symbol_type
)
&
[
:app_extension
,
:watch_extension
,
:watch2_extension
,
:tv_extension
,
:messages_extension
]).
empty?
[
:app_extension
,
:watch_extension
,
:watch2_extension
,
:tv_extension
,
:messages_extension
]).
empty?
is_app_extension
||=
aggregate_target
.
user_targets
.
any?
{
|
ut
|
ut
.
common_resolved_build_setting
(
'APPLICATION_EXTENSION_API_ONLY'
)
==
'YES'
}
is_app_extension
||=
aggregate_target
.
user_targets
.
any?
{
|
ut
|
ut
.
common_resolved_build_setting
(
'APPLICATION_EXTENSION_API_ONLY'
)
==
'YES'
}
aggregate_target
.
pod_targets
.
each
do
|
pod_target
|
aggregate_target
.
pod_targets
.
each
do
|
pod_target
|
test_only_pod_targets
.
delete
(
pod_target
)
configure_app_extension_api_only_for_target
(
aggregate_target
)
if
is_app_extension
configure_app_extension_api_only_for_target
(
aggregate_target
)
if
is_app_extension
unless
pod_target
.
should_build?
unless
pod_target
.
should_build?
...
@@ -226,11 +228,26 @@ module Pod
...
@@ -226,11 +228,26 @@ module Pod
configure_app_extension_api_only_for_target
(
pod_target
)
if
is_app_extension
configure_app_extension_api_only_for_target
(
pod_target
)
if
is_app_extension
unless
pod_target
.
static_framework?
unless
pod_target
.
static_framework?
add_dependent_targets_to_native_target
(
pod_target
.
dependent_targets
,
pod_target
.
native_target
,
is_app_extension
,
pod_target
.
requires_frameworks?
,
frameworks_group
)
add_dependent_targets_to_native_target
(
pod_target
.
dependent_targets
,
pod_target
.
native_target
,
is_app_extension
,
pod_target
.
requires_frameworks?
,
frameworks_group
)
add_pod_target_test_dependencies
(
pod_target
,
frameworks_group
)
add_pod_target_test_dependencies
(
pod_target
,
frameworks_group
)
end
end
end
end
end
end
# Wire up remaining pod targets used only by tests and are not used by any aggregate target.
test_only_pod_targets
.
each
do
|
pod_target
|
unless
pod_target
.
should_build?
add_pod_target_test_dependencies
(
pod_target
,
frameworks_group
)
next
end
unless
pod_target
.
static_framework?
add_dependent_targets_to_native_target
(
pod_target
.
dependent_targets
,
pod_target
.
native_target
,
false
,
pod_target
.
requires_frameworks?
,
frameworks_group
)
add_pod_target_test_dependencies
(
pod_target
,
frameworks_group
)
end
end
end
end
# @param [String] pod The root name of the development pod.
# @param [String] pod The root name of the development pod.
...
...
spec/unit/installer/xcode/pods_project_generator_spec.rb
View file @
2183a670
...
@@ -291,6 +291,27 @@ module Pod
...
@@ -291,6 +291,27 @@ module Pod
@generator
.
send
(
:set_target_dependencies
)
@generator
.
send
(
:set_target_dependencies
)
end
end
it
'adds dependencies to pod targets that are not part of any aggregate target'
do
@target
.
stubs
(
:pod_targets
).
returns
([])
@generator
.
expects
(
:pod_targets
).
returns
([
@pod_target
])
mock_native_target
=
mock
(
'CoconutLib'
)
dependent_native_target
=
mock
(
'DependentNativeTarget'
)
dependent_target
=
mock
(
'dependent-target'
,
:dependent_targets
=>
[])
dependent_target
.
stubs
(
:should_build?
).
returns
(
true
)
dependent_target
.
stubs
(
:native_target
).
returns
(
dependent_native_target
)
@pod_target
.
stubs
(
:native_target
).
returns
(
mock_native_target
)
@pod_target
.
stubs
(
:test_native_targets
).
returns
([])
@pod_target
.
stubs
(
:dependent_targets
).
returns
([
dependent_target
])
@pod_target
.
stubs
(
:test_dependent_targets
).
returns
([])
@pod_target
.
stubs
(
:should_build?
=>
true
)
mock_native_target
.
expects
(
:add_dependency
).
with
(
dependent_native_target
)
@generator
.
send
(
:set_target_dependencies
)
end
it
'adds test dependencies to test native targets for a pod target that should not be built'
do
it
'adds test dependencies to test native targets for a pod target that should not be built'
do
mock_test_native_target
=
mock
(
'CoconutLib-Unit-Tests'
)
mock_test_native_target
=
mock
(
'CoconutLib-Unit-Tests'
)
test_dependent_native_target
=
mock
(
'TestDependentNativeTarget'
)
test_dependent_native_target
=
mock
(
'TestDependentNativeTarget'
)
...
...
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