From f011285dd667d203e839eb075e2edbe8000dbbb2 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Wed, 29 May 2013 19:21:10 +0900 Subject: [PATCH] app.sim_args --- lib/motion/project/config.rb | 3 ++- lib/motion/project/template/ios.rb | 2 +- lib/motion/project/template/osx.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/motion/project/config.rb b/lib/motion/project/config.rb index f8c99d17..d8ee73d7 100644 --- a/lib/motion/project/config.rb +++ b/lib/motion/project/config.rb @@ -47,7 +47,7 @@ module Motion; module Project end end - variable :name, :files, :build_dir, :specs_dir, :version, :motiondir, :arguments_passed_on_launch + variable :name, :files, :build_dir, :specs_dir, :version, :motiondir, :sim_args # Internal only. attr_accessor :build_mode, :spec_mode, :distribution_mode, :dependencies, @@ -80,6 +80,7 @@ module Motion; module Project @specs_dir = File.join(project_dir, 'spec') @version = '1.0' @detect_dependencies = true + @sim_args = [] end OSX_VERSION = `/usr/bin/sw_vers -productVersion`.strip.sub(/\.\d+$/, '').to_f diff --git a/lib/motion/project/template/ios.rb b/lib/motion/project/template/ios.rb index 5399b914..a4fdf5d6 100644 --- a/lib/motion/project/template/ios.rb +++ b/lib/motion/project/template/ios.rb @@ -88,7 +88,7 @@ task :simulator => ['build:simulator'] do env << ' SIM_SPEC_MODE=1' if App.config.spec_mode sim = File.join(App.config.bindir, 'ios/sim') debug = (ENV['debug'] ? 1 : (App.config.spec_mode ? '0' : '2')) - app_args = App.config.arguments_passed_on_launch || "" + app_args = App.config.sim_args.map { |x| '"' + x + '"' } App.info 'Simulate', app at_exit { system("stty echo") } if $stdout.tty? # Just in case the simulator launcher crashes and leaves the terminal without echo. sh "#{env} #{sim} #{debug} #{family_int} #{target} \"#{xcode}\" \"#{app}\" \"#{app_args}\"" diff --git a/lib/motion/project/template/osx.rb b/lib/motion/project/template/osx.rb index ca42a80f..3cd35c33 100644 --- a/lib/motion/project/template/osx.rb +++ b/lib/motion/project/template/osx.rb @@ -54,7 +54,7 @@ task :run => 'build:development' do sim = File.join(App.config.bindir, 'osx/sim') debug = (ENV['debug'] ? 1 : (App.config.spec_mode ? '0' : '2')) target = App.config.sdk_version - app_args = App.config.arguments_passed_on_launch || "" + app_args = App.config.sim_args.map { |x| '"' + x + '"' } App.info 'Run', exec at_exit { system("stty echo") } if $stdout.tty? # Just in case the process crashes and leaves the terminal without echo. sh "#{env} #{sim} #{debug} #{target} \"#{exec}\" \"#{app_args}\""