From addb4a25c0ea3d8f3423f6cd4409d4d6feee4889 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Fri, 15 Jun 2012 13:04:56 +0200 Subject: [PATCH] rake simulator now honors deployment_target option, fixed bug when supporting deployment_target --- lib/motion/project.rb | 2 +- lib/motion/project/config.rb | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/motion/project.rb b/lib/motion/project.rb index 32e4b313..1713d800 100644 --- a/lib/motion/project.rb +++ b/lib/motion/project.rb @@ -61,7 +61,7 @@ end desc "Run the simulator" task :simulator => ['build:simulator'] do app = App.config.app_bundle('iPhoneSimulator') - target = App.config.sdk_version + target = ENV['deployment_target'] || App.config.deployment_target # Cleanup the simulator application sandbox, to avoid having old resource files there. if ENV['clean'] diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index c90729f2..79b6ccd3 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -164,6 +164,12 @@ EOS end end + def supported_versions + @supported_versions ||= Dir.glob(File.join(motiondir, 'data/*')).select{|path| File.directory?(path)}.map do |path| + File.basename path + end + end + def build_dir unless File.directory?(@build_dir) tried = false @@ -288,9 +294,12 @@ EOS bs_files = [] deps = ['RubyMotion'] + frameworks_dependencies deps.each do |framework| - bs_path = File.join(datadir, 'BridgeSupport', framework + '.bridgesupport') - if File.exist?(bs_path) - bs_files << bs_path + supported_versions.each do |ver| + next if ver < deployment_target || sdk_version < ver + bs_path = File.join(datadir(ver), 'BridgeSupport', framework + '.bridgesupport') + if File.exist?(bs_path) + bs_files << bs_path + end end end bs_files