Commit 10ca8e78 authored by Olivier Halligon's avatar Olivier Halligon Committed by AliSoftware

[xcassets] Cleanup Pods-Resources.sh script

parent 8091852c
...@@ -83,7 +83,6 @@ module Pod ...@@ -83,7 +83,6 @@ module Pod
end end
script += RSYNC_CALL script += RSYNC_CALL
script += XCASSETS_COMPILE
script script
end end
...@@ -127,9 +126,6 @@ install_resource() ...@@ -127,9 +126,6 @@ install_resource()
echo "xcrun mapc \\"${PODS_ROOT}/$1\\" \\"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\\"" echo "xcrun mapc \\"${PODS_ROOT}/$1\\" \\"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\\""
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
;; ;;
*.xcassets)
XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'"
;;
/*) /*)
echo "$1" echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY" echo "$1" >> "$RESOURCES_TO_COPY"
...@@ -151,28 +147,6 @@ fi ...@@ -151,28 +147,6 @@ fi
rm -f "$RESOURCES_TO_COPY" rm -f "$RESOURCES_TO_COPY"
EOS EOS
XCASSETS_COMPILE = <<EOS
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT")
echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
EOS
end end
end end
end end
...@@ -113,9 +113,8 @@ module Pod ...@@ -113,9 +113,8 @@ module Pod
resources_by_config = {} resources_by_config = {}
target.user_build_configurations.keys.each do |config| target.user_build_configurations.keys.each do |config|
file_accessors = library_targets.select { |t| t.include_in_build_config?(config) }.flat_map(&:file_accessors) file_accessors = library_targets.select { |t| t.include_in_build_config?(config) }.flat_map(&:file_accessors)
resource_paths = file_accessors.flat_map { |accessor| accessor.resources.flat_map { |res| res.relative_path_from(project.path.dirname) } }
resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name.shellescape}.bundle" } } resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name.shellescape}.bundle" } }
resources_by_config[config] = (resource_paths + resource_bundles).uniq resources_by_config[config] = resource_bundles.uniq
resources_by_config[config] << bridge_support_file if bridge_support_file resources_by_config[config] << bridge_support_file if bridge_support_file
end end
resources_by_config resources_by_config
......
Subproject commit e35ee4d2dd475dd8407a3f3231a403a370b5d2a0 Subproject commit ae774302d2e3d88ceb991d7e04f0d99086376257
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