Rakefile in rhodes-3.2.0.beta.4 vs Rakefile in rhodes-3.2.0.beta.5

- old
+ new

@@ -254,10 +254,17 @@ $app_config["extensions"].is_a? Array extensions += $app_config[$config["platform"]]["extensions"] if $app_config[$config["platform"]] and $app_config[$config["platform"]]["extensions"] and $app_config[$config["platform"]]["extensions"].is_a? Array $app_config["extensions"] = extensions + capabilities = [] + capabilities += $app_config["capabilities"] if $app_config["capabilities"] and + $app_config["capabilities"].is_a? Array + capabilities += $app_config[$config["platform"]]["capabilities"] if $app_config[$config["platform"]] and + $app_config[$config["platform"]]["capabilities"] and $app_config[$config["platform"]]["capabilities"].is_a? Array + $app_config["capabilities"] = capabilities + $hidden_app = $app_config["hidden_app"].nil?() ? "0" : $app_config["hidden_app"] #application build configs application_build_configs = {} @@ -282,10 +289,20 @@ make_application_build_capabilities_header_file end end + task :qt do + $qtdir = ENV['QTDIR'] + unless (!$qtdir.nil?) and ($qtdir !~/^\s*$/) and File.directory?($qtdir) + puts "\nPlease, set QTDIR environment variable to Qt root directory path" + exit 1 + end + $qmake = File.join($qtdir, 'bin/qmake') + $macdeployqt = File.join($qtdir, 'bin/macdeployqt') + end + out = `javac -version 2>&1` puts "\n\nYour java bin folder does not appear to be on your path.\nThis is required to use rhodes.\n\n" unless $? == 0 end def copy_assets(asset) @@ -1049,11 +1066,11 @@ desc "Run application on RhoSimulator" task :rhosimulator_base => "config:common" do puts "rho_reload_app_changes : #{ENV['rho_reload_app_changes']}" $path = "" - $args = ["-approot='#{$app_path}'"] + $args = ["-approot='#{$app_path}'", "-rhodespath='#{$startdir}'"] cmd = nil if RUBY_PLATFORM =~ /(win|w)32$/ if $config['env']['paths']['rhosimulator'] and $config['env']['paths']['rhosimulator'].length() > 0 $path = File.join( $config['env']['paths']['rhosimulator'], "rhosimulator.exe" ) @@ -1107,20 +1124,44 @@ end sim_conf += $rhosim_config if $rhosim_config #check gem extensions + config_ext_paths = "" + extpaths = $app_config["extpaths"] $app_config["extensions"].each do |extname| - begin - $rhodes_extensions = nil - require extname - extpath = $rhodes_extensions[0] unless $rhodes_extensions.nil? - sim_conf += "ext_path='#{extpath}'\r\n" if extpath && extpath.length() > 0 - rescue Exception => e + + extpath = nil + extpaths.each do |p| + ep = File.join(p, extname) + if File.exists? ep + extpath = ep + break + end end + + if extpath.nil? + begin + $rhodes_extensions = nil + require extname + extpath = $rhodes_extensions[0] unless $rhodes_extensions.nil? + config_ext_paths += "#{extpath};" if extpath && extpath.length() > 0 + rescue Exception => e + end + else + + if $config["platform"] != "bb" + extyml = File.join(extpath, "ext.yml") + next if File.file? extyml + end + + config_ext_paths += "#{extpath};" if extpath && extpath.length() > 0 + end end + sim_conf += "ext_path=#{config_ext_paths}\r\n" if config_ext_paths && config_ext_paths.length() > 0 + fdir = File.join($app_path, 'rhosimulator') mkdir fdir unless File.exist?(fdir) fname = File.join(fdir, 'rhosimconfig.txt') File.open(fname, "wb") do |fconf| @@ -1149,9 +1190,13 @@ end namespace "build" do task :rhosimulator => "config:common" do + $rhodes_version = File.read(File.join($startdir,'version')).chomp + File.open(File.join($startdir, 'platform/shared/qt/rhodes/RhoSimulatorVersion.h'), "wb") do |fversion| + fversion.write( "#define RHOSIMULATOR_VERSION \"#{$rhodes_version}\"\n" ) + end if RUBY_PLATFORM =~ /(win|w)32$/ Rake::Task["build:win32:rhosimulator"].invoke elsif RUBY_PLATFORM =~ /darwin/ Rake::Task["build:osx:rhosimulator"].invoke else