Skip to content

Commit

Permalink
Merge 62245fc into 23abea7
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrikdamm committed Oct 1, 2013
2 parents 23abea7 + 62245fc commit 4cac74b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/cocoapods/generator/copy_resources_script.rb
Expand Up @@ -73,6 +73,7 @@ def script
script += %Q[install_resource "#{resource}"\n]
end
script += RSYNC_CALL
script += XCASSETS_COMPILE
script
end

Expand Down Expand Up @@ -109,6 +110,8 @@ def script
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"
;;
*.xcassets)
;;
/*)
echo "$1"
echo "$1" >> "$RESOURCES_TO_COPY"
Expand All @@ -131,6 +134,15 @@ def script
rm -f "$RESOURCES_TO_COPY"
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

0 comments on commit 4cac74b

Please sign in to comment.