rake simulator now honors deployment_target option, fixed bug when supporting deployment_target

This commit is contained in:
Laurent Sansonetti
2012-06-15 13:04:56 +02:00
parent 21d9e7abd8
commit addb4a25c0
2 changed files with 13 additions and 4 deletions

View File

@@ -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']

View File

@@ -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