assets/rakelib/ruboto.rake in ruboto-0.9.0.rc.0 vs assets/rakelib/ruboto.rake in ruboto-0.9.0.rc.1

- old
+ new

@@ -1,6 +1,10 @@ -if `ant -version` !~ /version (\d+)\.(\d+)\.(\d+)/ || $1.to_i < 1 || ($1.to_i == 1 && $2.to_i < 8) +require 'rbconfig' + +ANT_CMD = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw/i) ? "ant.bat" : "ant" + +if `#{ANT_CMD} -version` !~ /version (\d+)\.(\d+)\.(\d+)/ || $1.to_i < 1 || ($1.to_i == 1 && $2.to_i < 8) puts "ANT version 1.8.0 or later required. Version found: #{$1}.#{$2}.#{$3}" exit 1 end require 'time' @@ -180,21 +184,21 @@ task :test => :uninstall do Dir.chdir('test') do puts 'Running tests' sh "adb uninstall #{package}.tests" - sh "ant instrument install test" + sh "#{ANT_CMD} instrument install test" end end namespace :test do task :quick => :update_scripts do Dir.chdir('test') do puts 'Running quick tests' - sh 'ant instrument' - sh 'ant installi' - sh "ant run-tests-quick" + sh "#{ANT_CMD} instrument" + sh "#{ANT_CMD} installi" + sh "#{ANT_CMD} run-tests-quick" end end end file GEM_FILE @@ -396,12 +400,12 @@ return false if changed_prereqs.empty? changed_prereqs.each { |f| puts "#{f} changed." } puts "Forcing rebuild of #{apk_file}." end if release - sh 'ant release' + sh "#{ANT_CMD} release" else - sh 'ant debug' + sh "#{ANT_CMD} debug" end return true end def install_apk