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
9046e78e
Commit
9046e78e
authored
Nov 07, 2017
by
Igor Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add copied resources' paths to "Copy Pods Resources" output file list
parent
1392c8f0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
8 deletions
+62
-8
CHANGELOG.md
CHANGELOG.md
+4
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+25
-2
pod_target_integrator.rb
...ler/xcode/pods_project_generator/pod_target_integrator.rb
+7
-2
target_integrator_spec.rb
...staller/user_project_integrator/target_integrator_spec.rb
+25
-3
pod_target_integrator_spec.rb
...code/pods_project_generator/pod_target_integrator_spec.rb
+1
-1
No files found.
CHANGELOG.md
View file @
9046e78e
...
...
@@ -18,6 +18,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Add copied resources' paths to "Copy Pods Resources" output file list
[
igor-makarov
](
https://github.com/igor-makarov
)
[
#6936
](
https://github.com/CocoaPods/CocoaPods/issues/6936
)
*
Do not link system frameworks of test specs to library targets
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7205
](
https://github.com/CocoaPods/CocoaPods/pull/7205
)
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
9046e78e
...
...
@@ -190,6 +190,23 @@ module Pod
end
end
end
# Returns an extension in the target that corresponds to the
# resource's input extension.
#
# @return [String] The output extension.
#
def
output_extension_for_resource
(
input_extension
)
case
input_extension
when
'.storyboard'
then
'.storyboardc'
when
'.xib'
then
'.nib'
when
'.framework'
then
'.framework'
when
'.xcdatamodel'
then
'.mom'
when
'.xcdatamodeld'
then
'.momd'
when
'.xcmappingmodel'
then
'.cdm'
else
input_extension
end
end
end
# Integrates the user project targets. Only the targets that do **not**
...
...
@@ -263,8 +280,14 @@ module Pod
input_paths
=
[]
output_paths
=
[]
unless
resource_paths_by_config
.
values
.
all?
(
&
:empty?
)
input_paths
=
[
target
.
copy_resources_script_relative_path
,
*
resource_paths_by_config
.
values
.
flatten
.
uniq
]
output_paths
=
[
'${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
]
resource_paths_flattened
=
resource_paths_by_config
.
values
.
flatten
.
uniq
input_paths
=
[
target
.
copy_resources_script_relative_path
,
*
resource_paths_flattened
]
# convert input paths to output paths according to extensions
output_paths
=
resource_paths_flattened
.
map
do
|
input_path
|
base_path
=
'${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
output_extension
=
TargetIntegrator
.
output_extension_for_resource
(
File
.
extname
(
input_path
))
File
.
join
(
base_path
,
File
.
basename
(
input_path
,
File
.
extname
(
input_path
))
+
output_extension
)
end
end
TargetIntegrator
.
add_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
end
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
View file @
9046e78e
...
...
@@ -56,8 +56,13 @@ module Pod
input_paths
=
[]
output_paths
=
[]
unless
resource_paths
.
empty?
input_paths
=
[
script_path
,
*
resource_paths
.
flatten
.
uniq
]
output_paths
=
[
'${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
]
resource_paths_flattened
=
resource_paths
.
flatten
.
uniq
input_paths
=
[
script_path
,
*
resource_paths_flattened
]
output_paths
=
resource_paths_flattened
.
map
do
|
input_path
|
base_path
=
'${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
output_extension
=
UserProjectIntegrator
::
TargetIntegrator
.
output_extension_for_resource
(
File
.
extname
(
input_path
))
File
.
join
(
base_path
,
File
.
basename
(
input_path
,
File
.
extname
(
input_path
))
+
output_extension
)
end
end
UserProjectIntegrator
::
TargetIntegrator
.
add_copy_resources_script_phase_to_target
(
native_target
,
script_path
,
input_paths
,
output_paths
)
end
...
...
spec/unit/installer/user_project_integrator/target_integrator_spec.rb
View file @
9046e78e
...
...
@@ -301,19 +301,41 @@ module Pod
it
'adds copy pods resources input and output paths'
do
resource_paths_by_config
=
{
'Debug'
=>
[
'${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLib.bundle'
],
'Release'
=>
[
'${PODS_CONFIGURATION_BUILD_DIR}/ReleaseLib/ReleaseLib.bundle'
],
'Debug'
=>
[
'${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugDataModel.xcdatamodeld'
,
'${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugDataModel.xcdatamodel'
,
'${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugMappingModel.xcmappingmodel'
,
'${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLib.bundle'
,
],
'Release'
=>
[
'${PODS_CONFIGURATION_BUILD_DIR}/ReleaseLib/ReleaseLib.bundle'
,
'${PODS_CONFIGURATION_BUILD_DIR}/ReleaseLib/ReleaseLib.storyboard'
,
'${PODS_CONFIGURATION_BUILD_DIR}/ReleaseLib/ReleaseLibXIB.xib'
,
],
}
@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
.
sort
.
should
==
%w(
${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugDataModel.xcdatamodel
${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugDataModel.xcdatamodeld
${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugLib.bundle
${PODS_CONFIGURATION_BUILD_DIR}/DebugLib/DebugMappingModel.xcmappingmodel
${PODS_CONFIGURATION_BUILD_DIR}/ReleaseLib/ReleaseLib.bundle
${PODS_CONFIGURATION_BUILD_DIR}/ReleaseLib/ReleaseLib.storyboard
${PODS_CONFIGURATION_BUILD_DIR}/ReleaseLib/ReleaseLibXIB.xib
${SRCROOT}/../Pods/Target\ Support\ Files/Pods/Pods-resources.sh
)
phase
.
output_paths
.
sort
.
should
==
%w(${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH})
phase
.
output_paths
.
sort
.
should
==
%w(
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/DebugDataModel.mom
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/DebugDataModel.momd
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/DebugLib.bundle
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/DebugMappingModel.cdm
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ReleaseLib.bundle
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ReleaseLib.storyboardc
${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ReleaseLibXIB.nib
)
end
it
'does not add embed frameworks build phase input output paths with no frameworks'
do
...
...
spec/unit/installer/xcode/pods_project_generator/pod_target_integrator_spec.rb
View file @
9046e78e
...
...
@@ -53,7 +53,7 @@ module Pod
'${PODS_CONFIGURATION_BUILD_DIR}/TestResourceBundle.bundle'
,
]
@test_native_target
.
build_phases
[
1
].
output_paths
.
should
==
[
'${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
,
'${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}
/TestResourceBundle.bundle
'
,
]
end
...
...
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