Unverified Commit 800a49d4 authored by Dimitris Koutsogiorgas's avatar Dimitris Koutsogiorgas Committed by GitHub

Merge pull request #7526 from dnkoutso/app_icon_fix

Prevent `xcassets` compilation from stomping over the apps `xcassets`
parents 4739ff19 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)
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
Subproject commit 47a72afc0f4cd1cb4c13a17e756055b79e6a85b4
Subproject commit 8037f4d7cf4b08d5af3f6e2867dbfa15edaf9dc2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment