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
ae76d127
Unverified
Commit
ae76d127
authored
Jan 25, 2018
by
Dimitris Koutsogiorgas
Committed by
GitHub
Jan 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7368 from dnkoutso/always_update_paths
Always update input/output paths even if they are empty
parents
c0e41fa2
847d7a47
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
18 deletions
+37
-18
CHANGELOG.md
CHANGELOG.md
+4
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+8
-16
pod_target_integrator.rb
...ler/xcode/pods_project_generator/pod_target_integrator.rb
+2
-2
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+23
-0
No files found.
CHANGELOG.md
View file @
ae76d127
...
@@ -22,6 +22,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -22,6 +22,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Always update input/output paths even if they are empty
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7368
](
https://github.com/CocoaPods/CocoaPods/pull/7368
)
*
Unique all available pre-release versions when displaying
*
Unique all available pre-release versions when displaying
[
Samuel Giddins
](
https://github.com/segiddins
)
[
Samuel Giddins
](
https://github.com/segiddins
)
[
#7353
](
https://github.com/CocoaPods/CocoaPods/pull/7353
)
[
#7353
](
https://github.com/CocoaPods/CocoaPods/pull/7353
)
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
ae76d127
...
@@ -71,15 +71,11 @@ module Pod
...
@@ -71,15 +71,11 @@ module Pod
#
#
# @return [void]
# @return [void]
#
#
def
add
_embed_frameworks_script_phase_to_target
(
native_target
,
script_path
,
input_paths
=
[],
output_paths
=
[])
def
create_or_update
_embed_frameworks_script_phase_to_target
(
native_target
,
script_path
,
input_paths
=
[],
output_paths
=
[])
phase
=
TargetIntegrator
.
create_or_update_build_phase
(
native_target
,
BUILD_PHASE_PREFIX
+
EMBED_FRAMEWORK_PHASE_NAME
)
phase
=
TargetIntegrator
.
create_or_update_build_phase
(
native_target
,
BUILD_PHASE_PREFIX
+
EMBED_FRAMEWORK_PHASE_NAME
)
phase
.
shell_script
=
%("#{script_path}"\n)
phase
.
shell_script
=
%("#{script_path}"\n)
unless
input_paths
.
empty?
phase
.
input_paths
=
input_paths
phase
.
input_paths
=
input_paths
phase
.
output_paths
=
output_paths
end
unless
output_paths
.
empty?
phase
.
output_paths
=
output_paths
end
end
end
# Delete a 'Embed Pods Frameworks' Copy Files Build Phase if present
# Delete a 'Embed Pods Frameworks' Copy Files Build Phase if present
...
@@ -111,16 +107,12 @@ module Pod
...
@@ -111,16 +107,12 @@ module Pod
#
#
# @return [void]
# @return [void]
#
#
def
add
_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
=
[],
output_paths
=
[])
def
create_or_update
_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
=
[],
output_paths
=
[])
phase_name
=
COPY_PODS_RESOURCES_PHASE_NAME
phase_name
=
COPY_PODS_RESOURCES_PHASE_NAME
phase
=
TargetIntegrator
.
create_or_update_build_phase
(
native_target
,
BUILD_PHASE_PREFIX
+
phase_name
)
phase
=
TargetIntegrator
.
create_or_update_build_phase
(
native_target
,
BUILD_PHASE_PREFIX
+
phase_name
)
phase
.
shell_script
=
%("#{script_path}"\n)
phase
.
shell_script
=
%("#{script_path}"\n)
unless
input_paths
.
empty?
phase
.
input_paths
=
input_paths
phase
.
input_paths
=
input_paths
phase
.
output_paths
=
output_paths
end
unless
output_paths
.
empty?
phase
.
output_paths
=
output_paths
end
end
end
# Creates or update a shell script build phase for the given target.
# Creates or update a shell script build phase for the given target.
...
@@ -289,7 +281,7 @@ module Pod
...
@@ -289,7 +281,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
.
add
_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
...
@@ -322,7 +314,7 @@ module Pod
...
@@ -322,7 +314,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
.
add
_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 @
ae76d127
...
@@ -64,7 +64,7 @@ module Pod
...
@@ -64,7 +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
.
add
_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
# Find or create a 'Embed Pods Frameworks' Copy Files Build Phase
# Find or create a 'Embed Pods Frameworks' Copy Files Build Phase
...
@@ -81,7 +81,7 @@ module Pod
...
@@ -81,7 +81,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
.
add
_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
# @return [String] the message that should be displayed for the target
# @return [String] the message that should be displayed for the target
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
ae76d127
...
@@ -370,6 +370,29 @@ module Pod
...
@@ -370,6 +370,29 @@ module Pod
phase
.
output_paths
.
should
.
be
.
empty
phase
.
output_paths
.
should
.
be
.
empty
end
end
it
'updates embed frameworks phase if it becomes empty'
do
debug_non_vendored_framework
=
{
:name
=>
'DebugCompiledFramework.framework'
,
:input_path
=>
'${BUILT_PRODUCTS_DIR}/DebugCompiledFramework/DebugCompiledFramework.framework'
,
:output_path
=>
'${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DebugCompiledFramework.framework'
}
framework_paths_by_config
=
{
'Debug'
=>
[
debug_non_vendored_framework
],
}
@pod_bundle
.
stubs
(
:framework_paths_by_config
=>
framework_paths_by_config
)
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
input_paths
.
sort
.
should
==
%w(
${BUILT_PRODUCTS_DIR}/DebugCompiledFramework/DebugCompiledFramework.framework
${SRCROOT}/../Pods/Target\ Support\ Files/Pods/Pods-frameworks.sh
)
# Now pretend the same target has no more framework paths, it should update the targets input/output paths
@pod_bundle
.
stubs
(
:framework_paths_by_config
=>
{})
@target_integrator
.
integrate!
target
=
@target_integrator
.
send
(
:native_targets
).
first
phase
=
target
.
shell_script_build_phases
.
find
{
|
bp
|
bp
.
name
==
@embed_framework_phase_name
}
phase
.
input_paths
.
sort
.
should
.
be
.
empty
end
it
'adds embed frameworks build phase input and output paths for vendored and non vendored frameworks'
do
it
'adds embed frameworks build phase input and output paths for vendored and non vendored frameworks'
do
debug_vendored_framework
=
{
:name
=>
'DebugVendoredFramework.framework'
,
debug_vendored_framework
=
{
:name
=>
'DebugVendoredFramework.framework'
,
:input_path
=>
'${PODS_ROOT}/DebugVendoredFramework/ios/DebugVendoredFramework.framework'
,
:input_path
=>
'${PODS_ROOT}/DebugVendoredFramework/ios/DebugVendoredFramework.framework'
,
...
...
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