Commit 91dfebfd authored by Marius Rackwitz's avatar Marius Rackwitz

Only copy the required xcasset files into the user bundle

Before all xcassets used in pod sources where unconditionally integrated into the bundle's car file, even if the xcasset file wasn't referenced by the podspec. Now only files, which are explicitly specified in the spec, will be integrated.
parent c2eabdb0
...@@ -96,6 +96,8 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" ...@@ -96,6 +96,8 @@ mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY" > "$RESOURCES_TO_COPY"
XCASSET_FILES=""
install_resource() install_resource()
{ {
case $1 in case $1 in
...@@ -126,6 +128,7 @@ install_resource() ...@@ -126,6 +128,7 @@ install_resource()
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) *.xcassets)
XCASSET_FILES="$XCASSET_FILES '$1'"
;; ;;
/*) /*)
echo "$1" echo "$1"
...@@ -150,7 +153,7 @@ EOS ...@@ -150,7 +153,7 @@ EOS
XCASSETS_COMPILE = <<EOS XCASSETS_COMPILE = <<EOS
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ `find . -name '*.xcassets' | wc -l` -ne 0 ] if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n $XCASSET_FILES ]
then then
case "${TARGETED_DEVICE_FAMILY}" in case "${TARGETED_DEVICE_FAMILY}" in
1,2) 1,2)
...@@ -166,7 +169,7 @@ then ...@@ -166,7 +169,7 @@ then
TARGET_DEVICE_ARGS="--target-device mac" TARGET_DEVICE_ARGS="--target-device mac"
;; ;;
esac esac
find "${PWD}" -name "*.xcassets" -print0 | xargs -0 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}" 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 fi
EOS EOS
end end
......
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