Commit 669f926a authored by Fabio Pelosin's avatar Fabio Pelosin

Merge pull request #1427 from ulrikdamm/master

Compile .xcassets files from pods
parents f3d66709 1dc69810
...@@ -96,6 +96,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides ...@@ -96,6 +96,10 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
[Fabio Pelosin](https://github.com/irrationalfab) [Fabio Pelosin](https://github.com/irrationalfab)
[#1273](https://github.com/CocoaPods/CocoaPods/pull/1273) [#1273](https://github.com/CocoaPods/CocoaPods/pull/1273)
* Compiles xcassets from pods.
[Ulrik Damm](https://github.com/ulrikdamm)
[#1427](https://github.com/CocoaPods/CocoaPods/pull/1427)
###### Bug Fixes ###### Bug Fixes
* The search paths of vendored frameworks and libraries now are always * The search paths of vendored frameworks and libraries now are always
......
...@@ -73,6 +73,7 @@ module Pod ...@@ -73,6 +73,7 @@ module Pod
script += %Q[install_resource "#{resource}"\n] script += %Q[install_resource "#{resource}"\n]
end end
script += RSYNC_CALL script += RSYNC_CALL
script += XCASSETS_COMPILE
script script
end end
...@@ -109,6 +110,8 @@ install_resource() ...@@ -109,6 +110,8 @@ install_resource()
echo "xcrun momc \\"${PODS_ROOT}/$1\\" \\"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\\"" echo "xcrun momc \\"${PODS_ROOT}/$1\\" \\"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\\""
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
;; ;;
*.xcassets)
;;
/*) /*)
echo "$1" echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY" echo "$1" >> "$RESOURCES_TO_COPY"
...@@ -131,6 +134,15 @@ fi ...@@ -131,6 +134,15 @@ fi
rm -f "$RESOURCES_TO_COPY" rm -f "$RESOURCES_TO_COPY"
EOS EOS
XCASSETS_COMPILE = <<EOS
if [ `find . -name '*.xcassets' | wc -l` -ne 0 ]
then
DEVICE=`if [ "${TARGETED_DEVICE_FAMILY}" -eq 1 ]; then echo "iphone"; else echo "ipad"; fi`
actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" --target-device ${DEVICE} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app" `find $PWD -name '*.xcassets'`
fi
EOS
end end
end end
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