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
efeff72e
Unverified
Commit
efeff72e
authored
Jan 31, 2018
by
Dimitris Koutsogiorgas
Committed by
GitHub
Jan 31, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7384 from dnkoutso/limit_input_output_paths
Clear input/output paths if they exceed an arbitrary limit
parents
11f6642a
649665a6
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
0 deletions
+63
-0
CHANGELOG.md
CHANGELOG.md
+4
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+25
-0
pod_target_integrator.rb
...ler/xcode/pods_project_generator/pod_target_integrator.rb
+2
-0
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+17
-0
pod_target_integrator_spec.rb
...code/pods_project_generator/pod_target_integrator_spec.rb
+15
-0
No files found.
CHANGELOG.md
View file @
efeff72e
...
@@ -25,6 +25,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -25,6 +25,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Clear input/output paths if they exceed an arbitrary limit
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7362
](
https://github.com/CocoaPods/CocoaPods/issues/7362
)
*
Warn instead of throwing an exception when a development pod specifies an invalid license file path
*
Warn instead of throwing an exception when a development pod specifies an invalid license file path
[
Eric Amorde
](
https://github.com/amorde
)
[
Eric Amorde
](
https://github.com/amorde
)
[
#7377
](
https://github.com/CocoaPods/CocoaPods/issues/7377
)
[
#7377
](
https://github.com/CocoaPods/CocoaPods/issues/7377
)
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
efeff72e
...
@@ -40,6 +40,10 @@ module Pod
...
@@ -40,6 +40,10 @@ module Pod
#
#
COPY_PODS_RESOURCES_PHASE_NAME
=
'Copy Pods Resources'
.
freeze
COPY_PODS_RESOURCES_PHASE_NAME
=
'Copy Pods Resources'
.
freeze
# @return [Integer] the maximum number of input and output paths to use for a script phase
#
MAX_INPUT_OUTPUT_PATHS
=
1000
# @return [AggregateTarget] the target that should be integrated.
# @return [AggregateTarget] the target that should be integrated.
#
#
attr_reader
:target
attr_reader
:target
...
@@ -183,6 +187,25 @@ module Pod
...
@@ -183,6 +187,25 @@ module Pod
end
end
end
end
# Script phases can have a limited number of input and output paths due to each one being exported to `env`.
# A large number can cause a build failure because of limitations in `env`. See issue
# https://github.com/CocoaPods/CocoaPods/issues/7362.
#
# @param [Array<String>] input_paths
# The input paths to trim.
#
# @param [Array<String>] output_paths
# The output paths to trim.
#
# @return [void]
#
def
validate_input_output_path_limit
(
input_paths
,
output_paths
)
if
(
input_paths
.
count
+
output_paths
.
count
)
>
MAX_INPUT_OUTPUT_PATHS
input_paths
.
clear
output_paths
.
clear
end
end
# Returns an extension in the target that corresponds to the
# Returns an extension in the target that corresponds to the
# resource's input extension.
# resource's input extension.
#
#
...
@@ -281,6 +304,7 @@ module Pod
...
@@ -281,6 +304,7 @@ module Pod
File
.
join
(
base_path
,
File
.
basename
(
input_path
,
File
.
extname
(
input_path
))
+
output_extension
)
File
.
join
(
base_path
,
File
.
basename
(
input_path
,
File
.
extname
(
input_path
))
+
output_extension
)
end
.
uniq
end
.
uniq
end
end
TargetIntegrator
.
validate_input_output_path_limit
(
input_paths
,
output_paths
)
TargetIntegrator
.
create_or_update_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
TargetIntegrator
.
create_or_update_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
end
end
end
end
...
@@ -314,6 +338,7 @@ module Pod
...
@@ -314,6 +338,7 @@ module Pod
input_paths
=
[
target
.
embed_frameworks_script_relative_path
,
*
framework_paths_by_config
.
map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}.
flatten
.
compact
]
input_paths
=
[
target
.
embed_frameworks_script_relative_path
,
*
framework_paths_by_config
.
map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}.
flatten
.
compact
]
output_paths
=
framework_paths_by_config
.
map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}.
flatten
.
compact
.
uniq
output_paths
=
framework_paths_by_config
.
map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}.
flatten
.
compact
.
uniq
end
end
TargetIntegrator
.
validate_input_output_path_limit
(
input_paths
,
output_paths
)
TargetIntegrator
.
create_or_update_embed_frameworks_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
TargetIntegrator
.
create_or_update_embed_frameworks_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
end
end
end
end
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
View file @
efeff72e
...
@@ -64,6 +64,7 @@ module Pod
...
@@ -64,6 +64,7 @@ module Pod
File
.
join
(
base_path
,
File
.
basename
(
input_path
,
File
.
extname
(
input_path
))
+
output_extension
)
File
.
join
(
base_path
,
File
.
basename
(
input_path
,
File
.
extname
(
input_path
))
+
output_extension
)
end
end
end
end
UserProjectIntegrator
::
TargetIntegrator
.
validate_input_output_path_limit
(
input_paths
,
output_paths
)
UserProjectIntegrator
::
TargetIntegrator
.
create_or_update_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
UserProjectIntegrator
::
TargetIntegrator
.
create_or_update_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
end
end
...
@@ -81,6 +82,7 @@ module Pod
...
@@ -81,6 +82,7 @@ module Pod
input_paths
=
[
script_path
,
*
framework_paths
.
map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}.
flatten
.
compact
]
input_paths
=
[
script_path
,
*
framework_paths
.
map
{
|
fw
|
[
fw
[
:input_path
],
fw
[
:dsym_input_path
]]
}.
flatten
.
compact
]
output_paths
=
framework_paths
.
map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}.
flatten
.
compact
output_paths
=
framework_paths
.
map
{
|
fw
|
[
fw
[
:output_path
],
fw
[
:dsym_output_path
]]
}.
flatten
.
compact
end
end
UserProjectIntegrator
::
TargetIntegrator
.
validate_input_output_path_limit
(
input_paths
,
output_paths
)
UserProjectIntegrator
::
TargetIntegrator
.
create_or_update_embed_frameworks_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
UserProjectIntegrator
::
TargetIntegrator
.
create_or_update_embed_frameworks_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
end
end
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
efeff72e
...
@@ -299,6 +299,23 @@ module Pod
...
@@ -299,6 +299,23 @@ module Pod
phase
.
output_paths
.
should
.
be
.
empty
phase
.
output_paths
.
should
.
be
.
empty
end
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.
paths
=
(
0
..
500
).
map
do
|
i
|
"${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLibPng
#{
i
}
.png"
end
resource_paths_by_config
=
{
'Debug'
=>
[
paths
],
'Release'
=>
[
paths
],
}
@pod_bundle
.
stubs
(
:resource_paths_by_config
=>
resource_paths_by_config
)
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@copy_pods_resources_phase_name
}
phase
.
input_paths
.
should
==
[]
phase
.
output_paths
.
should
==
[]
end
it
'adds copy pods resources input and output paths'
do
it
'adds copy pods resources input and output paths'
do
resource_paths_by_config
=
{
resource_paths_by_config
=
{
'Debug'
=>
[
'Debug'
=>
[
...
...
spec/unit/installer/xcode/pods_project_generator/pod_target_integrator_spec.rb
View file @
efeff72e
...
@@ -30,6 +30,21 @@ module Pod
...
@@ -30,6 +30,21 @@ module Pod
@test_native_target
.
build_phases
[
1
].
shell_script
.
should
==
"
\"
${PODS_ROOT}/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-resources.sh
\"\n
"
@test_native_target
.
build_phases
[
1
].
shell_script
.
should
==
"
\"
${PODS_ROOT}/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-resources.sh
\"\n
"
end
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.
resource_paths
=
(
0
..
500
).
map
do
|
i
|
"${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLibPng
#{
i
}
.png"
end
@coconut_pod_target
.
stubs
(
:resource_paths
).
returns
(
resource_paths
)
PodTargetIntegrator
.
new
(
@coconut_pod_target
).
integrate!
@test_native_target
.
build_phases
.
map
(
&
:display_name
).
should
==
[
'[CP] Embed Pods Frameworks'
,
'[CP] Copy Pods Resources'
,
]
@test_native_target
.
build_phases
[
1
].
input_paths
.
should
==
[]
@test_native_target
.
build_phases
[
1
].
output_paths
.
should
==
[]
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'
]
...
...
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