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/15 21:01:45 UTC

svn commit: r695583 - in /incubator/buildr/trunk: lib/buildr/java/ant.rb lib/buildr/java/test_frameworks.rb spec/sandbox.rb

Author: assaf
Date: Mon Sep 15 12:01:44 2008
New Revision: 695583

URL: http://svn.apache.org/viewvc?rev=695583&view=rev
Log:
Ant JUnit task now runs entirely from classpath set during task definition, i.e. nothing adding to the root classpath. JUnit Report task, not so lucky, probably a classloading issue in TRaX.

Modified:
    incubator/buildr/trunk/lib/buildr/java/ant.rb
    incubator/buildr/trunk/lib/buildr/java/test_frameworks.rb
    incubator/buildr/trunk/spec/sandbox.rb

Modified: incubator/buildr/trunk/lib/buildr/java/ant.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/ant.rb?rev=695583&r1=695582&r2=695583&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/ant.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/ant.rb Mon Sep 15 12:01:44 2008
@@ -26,7 +26,7 @@
     VERSION = '1.7.1' unless const_defined?('VERSION')
 
     # Libraries used by Ant.
-    REQUIRES = [ "org.apache.ant:ant:jar:#{VERSION}", "org.apache.ant:ant-launcher:jar:#{VERSION}", 'xerces:xercesImpl:jar:2.6.2' ]
+    REQUIRES = "org.apache.ant:ant:jar:#{VERSION}", "org.apache.ant:ant-launcher:jar:#{VERSION}"
     Java.classpath << REQUIRES
 
     # :call-seq:

Modified: incubator/buildr/trunk/lib/buildr/java/test_frameworks.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/test_frameworks.rb?rev=695583&r1=695582&r2=695583&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/test_frameworks.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/test_frameworks.rb Mon Sep 15 12:01:44 2008
@@ -152,6 +152,8 @@
         rm_rf html_in ; mkpath html_in
         
         Buildr.ant('junit-report') do |ant|
+          ant.taskdef :name=>'junitreport', :classname=>'org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator',
+            :classpath=>Buildr.artifacts(JUnit::ANT_JUNIT).each(&:invoke).map(&:to_s).join(File::PATH_SEPARATOR)
           ant.junitreport :todir=>target do
             projects.select { |project| project.test.framework == :junit }.
               map { |project| project.test.report_to.to_s }.select { |path| File.exist?(path) }.
@@ -186,9 +188,7 @@
     VERSION = '4.4' unless const_defined?('VERSION')
     
     REQUIRES = ["junit:junit:jar:#{VERSION}"] + JMock::REQUIRES
-
-    # Ant-JUnit requires for JUnit and JUnit reports tasks.
-    Java.classpath << "org.apache.ant:ant-junit:jar:#{Ant::VERSION}"
+    ANT_JUNIT = "org.apache.ant:ant-junit:jar:#{Ant::VERSION}" #:nodoc:
 
     include TestFramework::JavaTest
     
@@ -213,6 +213,8 @@
           fail 'Option fork must be :once, :each or false.'
         end
         mkpath task.report_to.to_s
+        ant.taskdef :name=>'junit', :classname=>'org.apache.tools.ant.taskdefs.optional.junit.JUnitTask',
+          :classpath=>Buildr.artifacts(ANT_JUNIT).each(&:invoke).map(&:to_s).join(File::PATH_SEPARATOR)
         ant.junit forking.merge(:clonevm=>options[:clonevm] || false, :dir=>task.send(:project).path_to) do
           ant.classpath :path=>dependencies.join(File::PATH_SEPARATOR)
           (options[:properties] || []).each { |key, value| ant.sysproperty :key=>key, :value=>value }

Modified: incubator/buildr/trunk/spec/sandbox.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/sandbox.rb?rev=695583&r1=695582&r2=695583&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/sandbox.rb (original)
+++ incubator/buildr/trunk/spec/sandbox.rb Mon Sep 15 12:01:44 2008
@@ -24,7 +24,7 @@
 require 'buildr/java/groovyc'
 Java.load # Anything added to the classpath.
 task('buildr:scala:download').invoke
-artifacts(TestFramework.frameworks.map(&:dependencies).flatten).each { |a| file(a).invoke }
+artifacts(TestFramework.frameworks.map(&:dependencies).flatten, JUnit::ANT_JUNIT).each { |a| file(a).invoke }
 
 ENV['HOME'] = File.expand_path('tmp/home')