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
ad599ad3
Commit
ad599ad3
authored
Apr 26, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not include test dependencies input and output paths
parent
117efe78
Hide 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 @
ad599ad3
...
@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -20,6 +20,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### 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
*
Remove
[
system
]
declaration attribute from generated module maps
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7589
](
https://github.com/CocoaPods/CocoaPods/issues/7589
)
[
#7589
](
https://github.com/CocoaPods/CocoaPods/issues/7589
)
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
View file @
ad599ad3
...
@@ -52,7 +52,10 @@ module Pod
...
@@ -52,7 +52,10 @@ 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_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
=
[]
input_paths
=
[]
output_paths
=
[]
output_paths
=
[]
unless
resource_paths
.
empty?
unless
resource_paths
.
empty?
...
@@ -71,7 +74,11 @@ module Pod
...
@@ -71,7 +74,11 @@ 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_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
=
[]
input_paths
=
[]
output_paths
=
[]
output_paths
=
[]
unless
framework_paths
.
empty?
unless
framework_paths
.
empty?
...
...
spec/unit/installer/xcode/pods_project_generator/pod_target_integrator_spec.rb
View file @
ad599ad3
...
@@ -10,11 +10,19 @@ module Pod
...
@@ -10,11 +10,19 @@ module Pod
@project
=
Pod
::
Project
.
new
(
config
.
sandbox
.
project_path
)
@project
=
Pod
::
Project
.
new
(
config
.
sandbox
.
project_path
)
@project
.
save
@project
.
save
@target_definition
=
fixture_target_definition
@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_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
])
@coconut_pod_target
=
PodTarget
.
new
(
config
.
sandbox
,
false
,
{},
[],
Platform
.
ios
,
@native_target
=
stub
(
'NativeTarget'
,
:shell_script_build_phases
=>
[],
:build_phases
=>
[],
:project
=>
@project
)
[
@coconut_spec
,
*
@coconut_spec
.
recursive_subspecs
],
@test_native_target
=
stub
(
'TestNativeTarget'
,
:symbol_type
=>
:unit_test_bundle
,
:build_phases
=>
[],
:shell_script_build_phases
=>
[],
:project
=>
@project
)
[
@target_definition
])
@target_installation_result
=
TargetInstallationResult
.
new
(
@coconut_pod_target
,
@native_target
,
[],
[
@test_native_target
])
@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
end
describe
'#integrate!'
do
describe
'#integrate!'
do
...
@@ -30,7 +38,8 @@ module Pod
...
@@ -30,7 +38,8 @@ module Pod
end
end
it
'clears input and output paths from script phase if it exceeds limit'
do
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
|
resource_paths
=
(
0
..
500
).
map
do
|
i
|
"${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLibPng
#{
i
}
.png"
"${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLibPng
#{
i
}
.png"
end
end
...
@@ -45,7 +54,9 @@ module Pod
...
@@ -45,7 +54,9 @@ module Pod
end
end
it
'integrates test native targets with frameworks and resources script phase input and output paths'
do
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'
]
resource_paths
=
[
'${PODS_CONFIGURATION_BUILD_DIR}/TestResourceBundle.bundle'
]
@coconut_pod_target
.
stubs
(
:framework_paths
).
returns
(
framework_paths
)
@coconut_pod_target
.
stubs
(
:framework_paths
).
returns
(
framework_paths
)
@coconut_pod_target
.
stubs
(
:resource_paths
).
returns
(
resource_paths
)
@coconut_pod_target
.
stubs
(
:resource_paths
).
returns
(
resource_paths
)
...
@@ -71,8 +82,31 @@ module Pod
...
@@ -71,8 +82,31 @@ module Pod
]
]
end
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
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!
PodTargetIntegrator
.
new
(
@target_installation_result
).
integrate!
@test_native_target
.
build_phases
.
count
.
should
==
3
@test_native_target
.
build_phases
.
count
.
should
==
3
@test_native_target
.
build_phases
[
2
].
display_name
.
should
==
'[CP-User] Hello World'
@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