From 35d6021e682aca39b30a6b6eef97f3a4e2751dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 10 Oct 2013 16:54:11 +0200 Subject: [PATCH] [xcassets] Compile resources_dirs/*.xcassets into the app bundle. --- lib/motion/project/builder.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/motion/project/builder.rb b/lib/motion/project/builder.rb index ca5c5660..5af4a15e 100644 --- a/lib/motion/project/builder.rb +++ b/lib/motion/project/builder.rb @@ -342,6 +342,20 @@ EOS end end + # Compile Asset Catalog bundles. + xcassets = [] + config.resources_dirs.each do |dir| + xcassets.concat(Dir.glob(File.join(dir, '*.xcassets'))) if File.exist?(dir) + end + unless xcassets.empty? + xcassets.map! { |f| File.expand_path(f) } + sh "\"#{config.xcode_dir}/usr/bin/actool\" --output-format human-readable-text " \ + "--notices --warnings --platform #{config.deploy_platform.downcase} " \ + "--minimum-deployment-target #{config.deployment_target} " \ + "#{Array(config.device_family).map { |d| "--target-device #{d}" }.join(' ')} " \ + "--compress-pngs --compile \"#{bundle_path}\" \"#{xcassets.join('" "')}\"" + end + # Compile CoreData Model resources and SpriteKit atlas files. config.resources_dirs.each do |dir| if File.exist?(dir)