buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toulm...@apache.org
Subject svn commit: r965028 - in /buildr/trunk: CHANGELOG lib/buildr/java/jruby.rb spec/java/java_spec.rb
Date Sat, 17 Jul 2010 08:02:39 GMT
Author: toulmean
Date: Sat Jul 17 08:02:39 2010
New Revision: 965028

URL: http://svn.apache.org/viewvc?rev=965028&view=rev
Log:
BUILDR-479 Enforce using a minimal version of jruby

Modified:
    buildr/trunk/CHANGELOG
    buildr/trunk/lib/buildr/java/jruby.rb
    buildr/trunk/spec/java/java_spec.rb

Modified: buildr/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/buildr/trunk/CHANGELOG?rev=965028&r1=965027&r2=965028&view=diff
==============================================================================
--- buildr/trunk/CHANGELOG (original)
+++ buildr/trunk/CHANGELOG Sat Jul 17 08:02:39 2010
@@ -17,6 +17,7 @@
 * Fixed:  BUILDR-468 test:failed does not respect test.exclude
 * Fixed:  BUILDR-469 test:failed causes all transitive tests to run
 * Fixed:  BUILDR-472 ECJ dependency now required to build any java project
+* Fixed:  BUILDR-479 Enforce using a minimal version of jruby
 
 1.4.1 (2010-07-07)
 * Added:  BUILDR-420 Support external compiler

Modified: buildr/trunk/lib/buildr/java/jruby.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/java/jruby.rb?rev=965028&r1=965027&r2=965028&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/java/jruby.rb (original)
+++ buildr/trunk/lib/buildr/java/jruby.rb Sat Jul 17 08:02:39 2010
@@ -59,6 +59,11 @@ module Java
   # Since we already have a JVM loaded, we can use it to guess where JAVA_HOME is.
   # We set JAVA_HOME early so we can use it without calling Java.load first.
   ENV['JAVA_HOME'] ||= java.lang.System.getProperty("java.home")
+  
+  # This version is the minimal version Buildr will support.
+  # Any older version of JRuby will raise an exception.
+  JRUBY_MIN_VERSION = '1.5.1' 
+  raise "JRuby must be at least at version #{JRUBY_MIN_VERSION}" unless JRUBY_VERSION >=
JRUBY_MIN_VERSION
 
   class << self
 

Modified: buildr/trunk/spec/java/java_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/java_spec.rb?rev=965028&r1=965027&r2=965028&view=diff
==============================================================================
--- buildr/trunk/spec/java/java_spec.rb (original)
+++ buildr/trunk/spec/java/java_spec.rb Sat Jul 17 08:02:39 2010
@@ -41,6 +41,19 @@ unless RUBY_PLATFORM =~ /java/
       ENV_JAVA.replace @old_env_java
     end
   end
+else
+  describe 'JRuby environment' do
+    it 'should enforce a minimum version of jruby' do
+      jruby_version = JRUBY_VERSION
+      begin
+        JRUBY_VERSION = '-1'
+        lambda {  load File.expand_path('../lib/buildr/java/jruby.rb') }.should raise(/JRuby
must be at least at version .*/)
+      ensure
+        JRUBY_VERSION = jruby_version
+      end 
+    
+    end
+  end
 end
 
 



Mime
View raw message