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
57fc1e50
Commit
57fc1e50
authored
Jan 08, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not include test spec resources and framework paths of dependent targets into test scripts
parent
88276c47
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
16 deletions
+26
-16
CHANGELOG.md
CHANGELOG.md
+4
-0
pod_xcconfig.rb
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
+2
-2
pods_project_generator.rb
lib/cocoapods/installer/xcode/pods_project_generator.rb
+1
-1
pod_target_installer.rb
...ller/xcode/pods_project_generator/pod_target_installer.rb
+12
-6
pod_target_integrator.rb
...ler/xcode/pods_project_generator/pod_target_integrator.rb
+2
-2
pod_target.rb
lib/cocoapods/target/pod_target.rb
+3
-3
pods_project_generator_spec.rb
spec/unit/installer/xcode/pods_project_generator_spec.rb
+2
-2
No files found.
CHANGELOG.md
View file @
57fc1e50
...
@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -14,6 +14,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Do not include test spec resources and framework paths of dependent targets into test scripts
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7318
](
https://github.com/CocoaPods/CocoaPods/pull/7318
)
*
Restore
`development_pod_targets`
public method in installer
*
Restore
`development_pod_targets`
public method in installer
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7292
](
https://github.com/CocoaPods/CocoaPods/pull/7292
)
[
#7292
](
https://github.com/CocoaPods/CocoaPods/pull/7292
)
...
...
lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
View file @
57fc1e50
...
@@ -75,8 +75,8 @@ module Pod
...
@@ -75,8 +75,8 @@ module Pod
if
@test_xcconfig
if
@test_xcconfig
test_dependent_targets
=
[
target
,
*
target
.
recursive_test_dependent_targets
].
uniq
test_dependent_targets
=
[
target
,
*
target
.
recursive_test_dependent_targets
].
uniq
@xcconfig
.
merge!
XCConfigHelper
.
search_paths_for_dependent_targets
(
target
,
test_dependent_targets
-
recursive_dependent_targets
,
@test_xcconfig
)
@xcconfig
.
merge!
XCConfigHelper
.
search_paths_for_dependent_targets
(
target
,
test_dependent_targets
-
recursive_dependent_targets
,
@test_xcconfig
)
XCConfigHelper
.
generate_vendored_build_settings
(
nil
,
target
.
all_
test_
dependent_targets
,
@xcconfig
,
true
,
@test_xcconfig
)
XCConfigHelper
.
generate_vendored_build_settings
(
nil
,
target
.
all_dependent_targets
,
@xcconfig
,
true
,
@test_xcconfig
)
XCConfigHelper
.
generate_other_ld_flags
(
nil
,
target
.
all_
test_
dependent_targets
,
@xcconfig
)
XCConfigHelper
.
generate_other_ld_flags
(
nil
,
target
.
all_dependent_targets
,
@xcconfig
)
XCConfigHelper
.
generate_ld_runpath_search_paths
(
target
,
false
,
true
,
@xcconfig
)
XCConfigHelper
.
generate_ld_runpath_search_paths
(
target
,
false
,
true
,
@xcconfig
)
end
end
@xcconfig
@xcconfig
...
...
lib/cocoapods/installer/xcode/pods_project_generator.rb
View file @
57fc1e50
...
@@ -288,7 +288,7 @@ module Pod
...
@@ -288,7 +288,7 @@ module Pod
private
private
def
add_pod_target_test_dependencies
(
pod_target
,
frameworks_group
)
def
add_pod_target_test_dependencies
(
pod_target
,
frameworks_group
)
test_dependent_targets
=
pod_target
.
all_
test_
dependent_targets
test_dependent_targets
=
pod_target
.
all_dependent_targets
pod_target
.
test_specs_by_native_target
.
each
do
|
test_native_target
,
test_specs
|
pod_target
.
test_specs_by_native_target
.
each
do
|
test_native_target
,
test_specs
|
test_dependent_targets
.
reject
(
&
:should_build?
).
each
do
|
test_dependent_target
|
test_dependent_targets
.
reject
(
&
:should_build?
).
each
do
|
test_dependent_target
|
add_resource_bundles_to_native_target
(
test_dependent_target
,
test_native_target
)
add_resource_bundles_to_native_target
(
test_dependent_target
,
test_native_target
)
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb
View file @
57fc1e50
...
@@ -242,7 +242,7 @@ module Pod
...
@@ -242,7 +242,7 @@ module Pod
product_type
=
target
.
product_type_for_test_type
(
test_type
)
product_type
=
target
.
product_type_for_test_type
(
test_type
)
name
=
target
.
test_target_label
(
test_type
)
name
=
target
.
test_target_label
(
test_type
)
platform_name
=
target
.
platform
.
name
platform_name
=
target
.
platform
.
name
language
=
target
.
all_
test_
dependent_targets
.
any?
(
&
:uses_swift?
)
?
:
swift
:
:objc
language
=
target
.
all_dependent_targets
.
any?
(
&
:uses_swift?
)
?
:
swift
:
:objc
native_test_target
=
project
.
new_target
(
product_type
,
name
,
platform_name
,
deployment_target
,
nil
,
language
)
native_test_target
=
project
.
new_target
(
product_type
,
name
,
platform_name
,
deployment_target
,
nil
,
language
)
native_test_target
.
product_reference
.
name
=
name
native_test_target
.
product_reference
.
name
=
name
...
@@ -401,9 +401,12 @@ module Pod
...
@@ -401,9 +401,12 @@ module Pod
#
#
def
create_test_target_copy_resources_script
(
test_type
)
def
create_test_target_copy_resources_script
(
test_type
)
path
=
target
.
copy_resources_script_path_for_test_type
(
test_type
)
path
=
target
.
copy_resources_script_path_for_test_type
(
test_type
)
pod_targets
=
target
.
all_
test_
dependent_targets
pod_targets
=
target
.
all_dependent_targets
resource_paths_by_config
=
target
.
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
resources_by_config
|
resource_paths_by_config
=
target
.
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
resources_by_config
|
resources_by_config
[
config
]
=
pod_targets
.
flat_map
(
&
:resource_paths
)
resources_by_config
[
config
]
=
pod_targets
.
flat_map
do
|
pod_target
|
include_test_spec_paths
=
pod_target
==
target
pod_target
.
resource_paths
(
include_test_spec_paths
)
end
end
end
generator
=
Generator
::
CopyResourcesScript
.
new
(
resource_paths_by_config
,
target
.
platform
)
generator
=
Generator
::
CopyResourcesScript
.
new
(
resource_paths_by_config
,
target
.
platform
)
update_changed_file
(
generator
,
path
)
update_changed_file
(
generator
,
path
)
...
@@ -419,9 +422,12 @@ module Pod
...
@@ -419,9 +422,12 @@ module Pod
#
#
def
create_test_target_embed_frameworks_script
(
test_type
)
def
create_test_target_embed_frameworks_script
(
test_type
)
path
=
target
.
embed_frameworks_script_path_for_test_type
(
test_type
)
path
=
target
.
embed_frameworks_script_path_for_test_type
(
test_type
)
pod_targets
=
target
.
all_
test_
dependent_targets
pod_targets
=
target
.
all_dependent_targets
framework_paths_by_config
=
target
.
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
paths_by_config
|
framework_paths_by_config
=
target
.
user_build_configurations
.
keys
.
each_with_object
({})
do
|
config
,
paths_by_config
|
paths_by_config
[
config
]
=
pod_targets
.
flat_map
(
&
:framework_paths
)
paths_by_config
[
config
]
=
pod_targets
.
flat_map
do
|
pod_target
|
include_test_spec_paths
=
pod_target
==
target
pod_target
.
framework_paths
(
include_test_spec_paths
)
end
end
end
generator
=
Generator
::
EmbedFrameworksScript
.
new
(
framework_paths_by_config
)
generator
=
Generator
::
EmbedFrameworksScript
.
new
(
framework_paths_by_config
)
update_changed_file
(
generator
,
path
)
update_changed_file
(
generator
,
path
)
...
@@ -435,7 +441,7 @@ module Pod
...
@@ -435,7 +441,7 @@ module Pod
#
#
def
test_target_swift_debug_hack
(
test_target_bc
)
def
test_target_swift_debug_hack
(
test_target_bc
)
return
unless
test_target_bc
.
debug?
return
unless
test_target_bc
.
debug?
return
unless
target
.
all_
test_
dependent_targets
.
any?
(
&
:uses_swift?
)
return
unless
target
.
all_dependent_targets
.
any?
(
&
:uses_swift?
)
ldflags
=
test_target_bc
.
build_settings
[
'OTHER_LDFLAGS'
]
||=
'$(inherited)'
ldflags
=
test_target_bc
.
build_settings
[
'OTHER_LDFLAGS'
]
||=
'$(inherited)'
ldflags
<<
' -lswiftSwiftOnoneSupport'
ldflags
<<
' -lswiftSwiftOnoneSupport'
end
end
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
View file @
57fc1e50
...
@@ -52,7 +52,7 @@ module Pod
...
@@ -52,7 +52,7 @@ module Pod
def
add_copy_resources_script_phase
(
native_target
)
def
add_copy_resources_script_phase
(
native_target
)
test_type
=
target
.
test_type_for_product_type
(
native_target
.
symbol_type
)
test_type
=
target
.
test_type_for_product_type
(
native_target
.
symbol_type
)
script_path
=
"${PODS_ROOT}/
#{
target
.
copy_resources_script_path_for_test_type
(
test_type
).
relative_path_from
(
target
.
sandbox
.
root
)
}
"
script_path
=
"${PODS_ROOT}/
#{
target
.
copy_resources_script_path_for_test_type
(
test_type
).
relative_path_from
(
target
.
sandbox
.
root
)
}
"
resource_paths
=
target
.
all_
test_
dependent_targets
.
flat_map
(
&
:resource_paths
)
resource_paths
=
target
.
all_dependent_targets
.
flat_map
(
&
:resource_paths
)
input_paths
=
[]
input_paths
=
[]
output_paths
=
[]
output_paths
=
[]
unless
resource_paths
.
empty?
unless
resource_paths
.
empty?
...
@@ -74,7 +74,7 @@ module Pod
...
@@ -74,7 +74,7 @@ module Pod
def
add_embed_frameworks_script_phase
(
native_target
)
def
add_embed_frameworks_script_phase
(
native_target
)
test_type
=
target
.
test_type_for_product_type
(
native_target
.
symbol_type
)
test_type
=
target
.
test_type_for_product_type
(
native_target
.
symbol_type
)
script_path
=
"${PODS_ROOT}/
#{
target
.
embed_frameworks_script_path_for_test_type
(
test_type
).
relative_path_from
(
target
.
sandbox
.
root
)
}
"
script_path
=
"${PODS_ROOT}/
#{
target
.
embed_frameworks_script_path_for_test_type
(
test_type
).
relative_path_from
(
target
.
sandbox
.
root
)
}
"
framework_paths
=
target
.
all_
test_
dependent_targets
.
flat_map
(
&
:framework_paths
)
framework_paths
=
target
.
all_dependent_targets
.
flat_map
(
&
:framework_paths
)
input_paths
=
[]
input_paths
=
[]
output_paths
=
[]
output_paths
=
[]
unless
framework_paths
.
empty?
unless
framework_paths
.
empty?
...
...
lib/cocoapods/target/pod_target.rb
View file @
57fc1e50
...
@@ -468,10 +468,10 @@ module Pod
...
@@ -468,10 +468,10 @@ module Pod
end
end
end
end
# @return [Array<PodTarget>] the canonical list of
test
dependent targets this target has a dependency upon.
# @return [Array<PodTarget>] the canonical list of dependent targets this target has a dependency upon.
# This
includes the parent target as well as its transitive dependencie
s.
# This
list includes the target itself as well as its recursive dependent and test dependent target
s.
#
#
def
all_
test_
dependent_targets
def
all_dependent_targets
[
self
,
*
recursive_dependent_targets
,
*
recursive_test_dependent_targets
].
uniq
[
self
,
*
recursive_dependent_targets
,
*
recursive_test_dependent_targets
].
uniq
end
end
...
...
spec/unit/installer/xcode/pods_project_generator_spec.rb
View file @
57fc1e50
...
@@ -351,7 +351,7 @@ module Pod
...
@@ -351,7 +351,7 @@ module Pod
test_dependent_target
.
expects
(
:should_build?
).
returns
(
true
)
test_dependent_target
.
expects
(
:should_build?
).
returns
(
true
)
@pod_target
.
stubs
(
:test_native_targets
).
returns
([
mock_test_native_target
])
@pod_target
.
stubs
(
:test_native_targets
).
returns
([
mock_test_native_target
])
@pod_target
.
stubs
(
:all_
test_
dependent_targets
).
returns
([
test_dependent_target
])
@pod_target
.
stubs
(
:all_dependent_targets
).
returns
([
test_dependent_target
])
@pod_target
.
stubs
(
:should_build?
=>
false
)
@pod_target
.
stubs
(
:should_build?
=>
false
)
mock_test_native_target
.
expects
(
:add_dependency
).
with
(
test_dependent_native_target
)
mock_test_native_target
.
expects
(
:add_dependency
).
with
(
test_dependent_native_target
)
...
@@ -384,7 +384,7 @@ module Pod
...
@@ -384,7 +384,7 @@ module Pod
@pod_target
.
test_specs
.
first
.
requires_app_host
=
true
@pod_target
.
test_specs
.
first
.
requires_app_host
=
true
@pod_target
.
stubs
(
:test_native_targets
).
returns
([
mock_test_native_target
])
@pod_target
.
stubs
(
:test_native_targets
).
returns
([
mock_test_native_target
])
@pod_target
.
stubs
(
:all_
test_
dependent_targets
).
returns
([
test_dependent_target
])
@pod_target
.
stubs
(
:all_dependent_targets
).
returns
([
test_dependent_target
])
@pod_target
.
stubs
(
:should_build?
=>
false
)
@pod_target
.
stubs
(
:should_build?
=>
false
)
mock_test_native_target
.
expects
(
:add_dependency
).
with
(
test_dependent_native_target
)
mock_test_native_target
.
expects
(
:add_dependency
).
with
(
test_dependent_native_target
)
...
...
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