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
990661bf
Commit
990661bf
authored
Mar 19, 2018
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly merge manually compiled `xcassets` resources with the app target
parent
4739ff19
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
14 deletions
+31
-14
CHANGELOG.md
CHANGELOG.md
+4
-0
copy_resources_script.rb
lib/cocoapods/generator/copy_resources_script.rb
+4
-0
target_integrator.rb
...ds/installer/user_project_integrator/target_integrator.rb
+21
-8
pod_target_integrator.rb
...ler/xcode/pods_project_generator/pod_target_integrator.rb
+1
-5
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
No files found.
CHANGELOG.md
View file @
990661bf
...
...
@@ -55,6 +55,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
*
Prevent
`xcassets`
compilation from stomping over the apps
`xcassets`
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7003
](
https://github.com/CocoaPods/CocoaPods/issues/7003
)
*
Fix script phase output path for
`.xcasset`
resources
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7511
](
https://github.com/CocoaPods/CocoaPods/issues/7511
)
...
...
lib/cocoapods/generator/copy_resources_script.rb
View file @
990661bf
...
...
@@ -212,7 +212,11 @@ then
fi
done <<<"$OTHER_XCASSETS"
if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
printf "%s
\\
0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
else
printf "%s
\\
0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist"
fi
fi
EOS
end
...
...
lib/cocoapods/installer/user_project_integrator/target_integrator.rb
View file @
990661bf
...
...
@@ -220,6 +220,9 @@ module Pod
# Returns an extension in the target that corresponds to the
# resource's input extension.
#
# @param [String] input_extension
# The input extension to map to.
#
# @return [String] The output extension.
#
def
output_extension_for_resource
(
input_extension
)
...
...
@@ -234,6 +237,23 @@ module Pod
else
input_extension
end
end
# Returns the resource output paths for all given input paths.
#
# @param [Array<String>] resource_input_paths
# The input paths to map to.
#
# @return [Array<String>] The resource output paths.
#
def
resource_output_paths
(
resource_input_paths
)
resource_input_paths
.
map
do
|
resource_input_path
|
base_path
=
'${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}'
extname
=
File
.
extname
(
resource_input_path
)
basename
=
extname
==
'.xcassets'
?
'Assets'
:
File
.
basename
(
resource_input_path
)
output_extension
=
TargetIntegrator
.
output_extension_for_resource
(
extname
)
File
.
join
(
base_path
,
File
.
basename
(
basename
,
extname
)
+
output_extension
)
end
.
uniq
end
end
# Integrates the user project targets. Only the targets that do **not**
...
...
@@ -309,14 +329,7 @@ module Pod
else
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}'
extname
=
File
.
extname
(
input_path
)
basename
=
extname
==
'.xcassets'
?
'Assets'
:
File
.
basename
(
input_path
)
output_extension
=
TargetIntegrator
.
output_extension_for_resource
(
extname
)
File
.
join
(
base_path
,
File
.
basename
(
basename
,
extname
)
+
output_extension
)
end
.
uniq
output_paths
=
TargetIntegrator
.
resource_output_paths
(
resource_paths_flattened
)
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
)
end
...
...
lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
View file @
990661bf
...
...
@@ -58,11 +58,7 @@ module Pod
unless
resource_paths
.
empty?
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
output_paths
=
UserProjectIntegrator
::
TargetIntegrator
.
resource_output_paths
(
resource_paths_flattened
)
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
)
...
...
cocoapods-integration-specs
@
8037f4d7
Subproject commit
47a72afc0f4cd1cb4c13a17e756055b79e6a85b4
Subproject commit
8037f4d7cf4b08d5af3f6e2867dbfa15edaf9dc2
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