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
781d5047
Unverified
Commit
781d5047
authored
Apr 27, 2018
by
Dimitris Koutsogiorgas
Committed by
GitHub
Apr 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7688 from dnkoutso/fix_resource_framework_paths
Do not include test dependencies input and output paths
parents
071e84d9
ad599ad3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
9 deletions
+54
-9
CHANGELOG.md
CHANGELOG.md
+4
-0
pod_target_integrator.rb
...ler/xcode/pods_project_generator/pod_target_integrator.rb
+9
-2
pod_target_integrator_spec.rb
...code/pods_project_generator/pod_target_integrator_spec.rb
+41
-7
No files found.
CHANGELOG.md
View file @
781d5047
...
...
@@ -23,6 +23,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Do not include test dependencies input and output paths
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7688
](
https://github.com/CocoaPods/CocoaPods/pull/7688
)
*
Remove
[
system
]
declaration attribute from generated module maps
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7589
](
https://github.com/CocoaPods/CocoaPods/issues/7589
)
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
View file @
781d5047
...
...
@@ -52,7 +52,10 @@ module Pod
def
add_copy_resources_script_phase
(
native_target
)
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
)
}
"
resource_paths
=
target
.
all_dependent_targets
.
flat_map
(
&
:resource_paths
)
resource_paths
=
target
.
all_dependent_targets
.
flat_map
do
|
dependent_target
|
include_test_spec_paths
=
dependent_target
==
target
dependent_target
.
resource_paths
(
include_test_spec_paths
)
end
input_paths
=
[]
output_paths
=
[]
unless
resource_paths
.
empty?
...
...
@@ -71,7 +74,11 @@ module Pod
def
add_embed_frameworks_script_phase
(
native_target
)
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
)
}
"
framework_paths
=
target
.
all_dependent_targets
.
flat_map
(
&
:framework_paths
)
all_dependent_targets
=
target
.
all_dependent_targets
framework_paths
=
all_dependent_targets
.
flat_map
do
|
dependent_target
|
include_test_spec_paths
=
dependent_target
==
target
dependent_target
.
framework_paths
(
include_test_spec_paths
)
end
input_paths
=
[]
output_paths
=
[]
unless
framework_paths
.
empty?
...
...
spec/unit/installer/xcode/pods_project_generator/pod_target_integrator_spec.rb
View file @
781d5047
...
...
@@ -10,11 +10,19 @@ module Pod
@project
=
Pod
::
Project
.
new
(
config
.
sandbox
.
project_path
)
@project
.
save
@target_definition
=
fixture_target_definition
@banana_spec
=
fixture_spec
(
'banana-lib/BananaLib.podspec'
)
@banana_pod_target
=
PodTarget
.
new
(
config
.
sandbox
,
false
,
{},
[],
Platform
.
ios
,
[
@banana_spec
],
[
@target_definition
])
@coconut_spec
=
fixture_spec
(
'coconut-lib/CoconutLib.podspec'
)
@coconut_pod_target
=
PodTarget
.
new
(
config
.
sandbox
,
false
,
{},
[],
Platform
.
ios
,
[
@coconut_spec
,
*
@coconut_spec
.
recursive_subspecs
],
[
@target_definition
])
@native_target
=
stub
(
'NativeTarget'
,
:shell_script_build_phases
=>
[],
:build_phases
=>
[],
:project
=>
@project
)
@test_native_target
=
stub
(
'TestNativeTarget'
,
:symbol_type
=>
:unit_test_bundle
,
:build_phases
=>
[],
:shell_script_build_phases
=>
[],
:project
=>
@project
)
@target_installation_result
=
TargetInstallationResult
.
new
(
@coconut_pod_target
,
@native_target
,
[],
[
@test_native_target
])
@coconut_pod_target
=
PodTarget
.
new
(
config
.
sandbox
,
false
,
{},
[],
Platform
.
ios
,
[
@coconut_spec
,
*
@coconut_spec
.
recursive_subspecs
],
[
@target_definition
])
@native_target
=
stub
(
'NativeTarget'
,
:shell_script_build_phases
=>
[],
:build_phases
=>
[],
:project
=>
@project
)
@test_native_target
=
stub
(
'TestNativeTarget'
,
:symbol_type
=>
:unit_test_bundle
,
:build_phases
=>
[],
:shell_script_build_phases
=>
[],
:project
=>
@project
)
@target_installation_result
=
TargetInstallationResult
.
new
(
@coconut_pod_target
,
@native_target
,
[],
[
@test_native_target
])
end
describe
'#integrate!'
do
...
...
@@ -30,7 +38,8 @@ module Pod
end
it
'clears input and output paths from script phase if it exceeds limit'
do
# The paths represented here will be 501 for input paths and 501 for output paths which will exceed the limit.
# The paths represented here will be 501 for input paths and 501 for output paths
# which will exceed the limit.
resource_paths
=
(
0
..
500
).
map
do
|
i
|
"${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLibPng
#{
i
}
.png"
end
...
...
@@ -45,7 +54,9 @@ module Pod
end
it
'integrates test native targets with frameworks and resources script phase input and output paths'
do
framework_paths
=
{
:name
=>
'Vendored.framework'
,
:input_path
=>
'${PODS_ROOT}/Vendored/Vendored.framework'
,
:output_path
=>
'${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Vendored.framework'
}
framework_paths
=
{
:name
=>
'Vendored.framework'
,
:input_path
=>
'${PODS_ROOT}/Vendored/Vendored.framework'
,
:output_path
=>
'${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Vendored.framework'
}
resource_paths
=
[
'${PODS_CONFIGURATION_BUILD_DIR}/TestResourceBundle.bundle'
]
@coconut_pod_target
.
stubs
(
:framework_paths
).
returns
(
framework_paths
)
@coconut_pod_target
.
stubs
(
:resource_paths
).
returns
(
resource_paths
)
...
...
@@ -71,8 +82,31 @@ module Pod
]
end
it
'excludes test framework and resource paths from dependent targets'
do
framework_paths
=
{
:name
=>
'TestVendored.framework'
,
:input_path
=>
'${PODS_ROOT}/Vendored/TestVendored.framework'
,
:output_path
=>
'${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TestVendored.framework'
}
resource_paths
=
[
'${PODS_CONFIGURATION_BUILD_DIR}/TestResourceBundle.bundle'
]
@banana_pod_target
.
stubs
(
:resource_paths
).
with
(
true
).
returns
(
resource_paths
)
@banana_pod_target
.
stubs
(
:framework_paths
).
with
(
true
).
returns
(
framework_paths
)
@banana_pod_target
.
expects
(
:resource_paths
).
with
(
false
).
returns
([])
@banana_pod_target
.
expects
(
:framework_paths
).
with
(
false
).
returns
([])
@coconut_pod_target
.
stubs
(
:dependent_targets
).
returns
([
@banana_pod_target
])
PodTargetIntegrator
.
new
(
@target_installation_result
).
integrate!
@test_native_target
.
build_phases
.
count
.
should
==
2
@test_native_target
.
build_phases
.
map
(
&
:display_name
).
should
==
[
'[CP] Embed Pods Frameworks'
,
'[CP] Copy Pods Resources'
,
]
@test_native_target
.
build_phases
[
0
].
input_paths
.
should
.
be
.
empty
@test_native_target
.
build_phases
[
0
].
output_paths
.
should
.
be
.
empty
@test_native_target
.
build_phases
[
1
].
input_paths
.
should
.
be
.
empty
@test_native_target
.
build_phases
[
1
].
output_paths
.
should
.
should
.
be
.
empty
end
it
'integrates test native target with shell script phases'
do
@coconut_spec
.
test_specs
.
first
.
script_phase
=
{
:name
=>
'Hello World'
,
:script
=>
'echo "Hello World"'
}
@coconut_spec
.
test_specs
.
first
.
script_phase
=
{
:name
=>
'Hello World'
,
:script
=>
'echo "Hello World"'
}
PodTargetIntegrator
.
new
(
@target_installation_result
).
integrate!
@test_native_target
.
build_phases
.
count
.
should
==
3
@test_native_target
.
build_phases
[
2
].
display_name
.
should
==
'[CP-User] Hello World'
...
...
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