You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by as...@apache.org on 2008/09/22 19:27:43 UTC

svn commit: r697904 - in /incubator/buildr/trunk/lib/buildr/java: jruby.rb rjb.rb

Author: assaf
Date: Mon Sep 22 10:27:42 2008
New Revision: 697904

URL: http://svn.apache.org/viewvc?rev=697904&view=rev
Log:
Java.classpath accepts procs for lazy-evaluation.  Required if we need to add a dependency to the root classpath (e.g. Ant) but determine the dependency after loading Buildr application (e.g. get the version number from build.yaml file).

Modified:
    incubator/buildr/trunk/lib/buildr/java/jruby.rb
    incubator/buildr/trunk/lib/buildr/java/rjb.rb

Modified: incubator/buildr/trunk/lib/buildr/java/jruby.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/jruby.rb?rev=697904&r1=697903&r2=697904&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/jruby.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/jruby.rb Mon Sep 22 10:27:42 2008
@@ -102,6 +102,7 @@
       # Most platforms requires tools.jar to be on the classpath.
       add_path[tools_jar] if tools_jar
       
+      classpath.map! { |path| Proc === path ? path.call : path }      
       Buildr.artifacts(classpath).map(&:to_s).each do |path|
         file(path).invoke
         add_path[path]

Modified: incubator/buildr/trunk/lib/buildr/java/rjb.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/rjb.rb?rev=697904&r1=697903&r2=697904&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/rjb.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/rjb.rb Mon Sep 22 10:27:42 2008
@@ -108,6 +108,7 @@
       return self if @loaded
       classpath << tools_jar if tools_jar
       
+      classpath.map! { |path| Proc === path ? path.call : path }
       cp = Buildr.artifacts(classpath).map(&:to_s).each { |path| file(path).invoke }
       java_opts = (ENV['JAVA_OPTS'] || ENV['JAVA_OPTIONS']).to_s.split
       ::Rjb.load cp.join(File::PATH_SEPARATOR), java_opts