buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From as...@apache.org
Subject svn commit: r697908 - in /incubator/buildr/trunk: lib/buildr/ lib/buildr/core/ lib/buildr/groovy/ lib/buildr/java/ lib/buildr/scala/ spec/ spec/addon/ spec/core/ spec/groovy/ spec/ide/ spec/java/ spec/packaging/ spec/scala/
Date Mon, 22 Sep 2008 17:28:20 GMT
Author: assaf
Date: Mon Sep 22 10:28:18 2008
New Revision: 697908

URL: http://svn.apache.org/viewvc?rev=697908&view=rev
Log:
Moved things around: Scala specific code is now under buildr/scala and Buildr::Scala namespace. Likewise, Groovy specific code under buildr/groovy and Buildr::Groovy.
Also organized specs by topic(?), so spec/java is separate from spec/packaging and spec/scala.

Added:
    incubator/buildr/trunk/lib/buildr/groovy/
    incubator/buildr/trunk/lib/buildr/groovy.rb
      - copied, changed from r697907, incubator/buildr/trunk/lib/buildr/java.rb
    incubator/buildr/trunk/lib/buildr/groovy/compiler.rb
    incubator/buildr/trunk/lib/buildr/java/compiler.rb
      - copied, changed from r697907, incubator/buildr/trunk/lib/buildr/java/compilers.rb
    incubator/buildr/trunk/lib/buildr/java/tests.rb
    incubator/buildr/trunk/lib/buildr/scala/
    incubator/buildr/trunk/lib/buildr/scala.rb
      - copied, changed from r697907, incubator/buildr/trunk/lib/buildr/java.rb
    incubator/buildr/trunk/lib/buildr/scala/compiler.rb
    incubator/buildr/trunk/lib/buildr/scala/tests.rb
    incubator/buildr/trunk/spec/addon/
    incubator/buildr/trunk/spec/addon/cobertura_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/cobertura_spec.rb
    incubator/buildr/trunk/spec/addon/emma_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/emma_spec.rb
    incubator/buildr/trunk/spec/addon/test_coverage_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/test_coverage_spec.rb
    incubator/buildr/trunk/spec/core/
    incubator/buildr/trunk/spec/core/application_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/application_spec.rb
    incubator/buildr/trunk/spec/core/artifact_namespace_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/artifact_namespace_spec.rb
    incubator/buildr/trunk/spec/core/build_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/build_spec.rb
    incubator/buildr/trunk/spec/core/checks_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/checks_spec.rb
    incubator/buildr/trunk/spec/core/common_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/common_spec.rb
    incubator/buildr/trunk/spec/core/compile_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/compile_spec.rb
    incubator/buildr/trunk/spec/core/project_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/project_spec.rb
    incubator/buildr/trunk/spec/core/test_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/test_spec.rb
    incubator/buildr/trunk/spec/core/transport_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/transport_spec.rb
    incubator/buildr/trunk/spec/groovy/
    incubator/buildr/trunk/spec/groovy/compiler_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/groovy_compilers_spec.rb
    incubator/buildr/trunk/spec/ide/
    incubator/buildr/trunk/spec/ide/eclipse_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/eclipse_spec.rb
    incubator/buildr/trunk/spec/java/
    incubator/buildr/trunk/spec/java/bdd_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/java_bdd_frameworks_spec.rb
    incubator/buildr/trunk/spec/java/compiler_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/java_compilers_spec.rb
    incubator/buildr/trunk/spec/java/java_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/java_spec.rb
    incubator/buildr/trunk/spec/java/packaging_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/java_packaging_spec.rb
    incubator/buildr/trunk/spec/java/tests_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/java_test_frameworks_spec.rb
    incubator/buildr/trunk/spec/packaging/
    incubator/buildr/trunk/spec/packaging/archive_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/archive_spec.rb
    incubator/buildr/trunk/spec/packaging/artifact_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/artifact_spec.rb
    incubator/buildr/trunk/spec/packaging/packaging_helper.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/packaging_helper.rb
    incubator/buildr/trunk/spec/packaging/packaging_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/packaging_spec.rb
    incubator/buildr/trunk/spec/scala/
    incubator/buildr/trunk/spec/scala/compiler_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/scala_compilers_spec.rb
    incubator/buildr/trunk/spec/scala/tests_spec.rb
      - copied, changed from r697907, incubator/buildr/trunk/spec/scala_test_frameworks_spec.rb
Removed:
    incubator/buildr/trunk/lib/buildr/java/compilers.rb
    incubator/buildr/trunk/lib/buildr/java/groovyc.rb
    incubator/buildr/trunk/lib/buildr/java/test_frameworks.rb
    incubator/buildr/trunk/spec/application_spec.rb
    incubator/buildr/trunk/spec/archive_spec.rb
    incubator/buildr/trunk/spec/artifact_namespace_spec.rb
    incubator/buildr/trunk/spec/artifact_spec.rb
    incubator/buildr/trunk/spec/build_spec.rb
    incubator/buildr/trunk/spec/checks_spec.rb
    incubator/buildr/trunk/spec/cobertura_spec.rb
    incubator/buildr/trunk/spec/common_spec.rb
    incubator/buildr/trunk/spec/compile_spec.rb
    incubator/buildr/trunk/spec/eclipse_spec.rb
    incubator/buildr/trunk/spec/emma_spec.rb
    incubator/buildr/trunk/spec/groovy_compilers_spec.rb
    incubator/buildr/trunk/spec/java_bdd_frameworks_spec.rb
    incubator/buildr/trunk/spec/java_compilers_spec.rb
    incubator/buildr/trunk/spec/java_packaging_spec.rb
    incubator/buildr/trunk/spec/java_spec.rb
    incubator/buildr/trunk/spec/java_test_frameworks_spec.rb
    incubator/buildr/trunk/spec/packaging_helper.rb
    incubator/buildr/trunk/spec/packaging_spec.rb
    incubator/buildr/trunk/spec/project_spec.rb
    incubator/buildr/trunk/spec/scala_compilers_spec.rb
    incubator/buildr/trunk/spec/scala_test_frameworks_spec.rb
    incubator/buildr/trunk/spec/test_coverage_spec.rb
    incubator/buildr/trunk/spec/test_spec.rb
    incubator/buildr/trunk/spec/transport_spec.rb
Modified:
    incubator/buildr/trunk/lib/buildr/core/application.rb
    incubator/buildr/trunk/lib/buildr/core/test.rb
    incubator/buildr/trunk/lib/buildr/java.rb
    incubator/buildr/trunk/lib/buildr/java/bdd_frameworks.rb
    incubator/buildr/trunk/spec/sandbox.rb
    incubator/buildr/trunk/spec/spec_helpers.rb

Modified: incubator/buildr/trunk/lib/buildr/core/application.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/core/application.rb?rev=697908&r1=697907&r2=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/core/application.rb (original)
+++ incubator/buildr/trunk/lib/buildr/core/application.rb Mon Sep 22 10:28:18 2008
@@ -123,7 +123,7 @@
       parse_options
       collect_tasks
       @home_dir = File.expand_path('.buildr', ENV['HOME'])
-      mkpath @home_dir unless File.exist?(@home_dir)
+      mkpath @home_dir, :verbose=>false unless File.exist?(@home_dir)
       @environment = ENV['BUILDR_ENV'] ||= 'development'
       @on_completion = []
       @on_failure = []

Modified: incubator/buildr/trunk/lib/buildr/core/test.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/core/test.rb?rev=697908&r1=697907&r2=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/core/test.rb (original)
+++ incubator/buildr/trunk/lib/buildr/core/test.rb Mon Sep 22 10:28:18 2008
@@ -24,7 +24,7 @@
   # The underlying test framework used by TestTask.
   # To add a new test framework, extend TestFramework::Base and add your framework using:
   #   Buildr::TestFramework << MyFramework
-  class TestFramework
+  module TestFramework
 
     class << self
 

Copied: incubator/buildr/trunk/lib/buildr/groovy.rb (from r697907, incubator/buildr/trunk/lib/buildr/java.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/groovy.rb?p2=incubator/buildr/trunk/lib/buildr/groovy.rb&p1=incubator/buildr/trunk/lib/buildr/java.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java.rb (original)
+++ incubator/buildr/trunk/lib/buildr/groovy.rb Mon Sep 22 10:28:18 2008
@@ -14,10 +14,4 @@
 # the License.
 
 
-require RUBY_PLATFORM == 'java' ? 'buildr/java/jruby' : 'buildr/java/rjb'
-require 'buildr/java/compilers'
-require 'buildr/java/test_frameworks'
-require 'buildr/java/bdd_frameworks'
-require 'buildr/java/packaging'
-require 'buildr/java/commands'
-require 'buildr/java/deprecated'
+require 'buildr/groovy/compiler'
\ No newline at end of file

Added: incubator/buildr/trunk/lib/buildr/groovy/compiler.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/groovy/compiler.rb?rev=697908&view=auto
==============================================================================
--- incubator/buildr/trunk/lib/buildr/groovy/compiler.rb (added)
+++ incubator/buildr/trunk/lib/buildr/groovy/compiler.rb Mon Sep 22 10:28:18 2008
@@ -0,0 +1,138 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+
+module Buildr::Compiler
+
+  # Groovyc compiler:
+  #  compile.using(:groovyc)
+  #
+  # You need to require 'buildr/java/groovyc' if you need to use this compiler.
+  #
+  # Used by default if .groovy files are found in the src/main/groovy directory (or src/test/groovy)
+  # and sets the target directory to target/classes (or target/test/classes).
+  #
+  # Groovyc is a joint compiler, this means that when selected for a project, this compiler is used
+  # to compile both groovy and java sources. It's recommended that Groovy sources are placed in the
+  # src/main/groovy directory, even though this compiler also looks in src/main/java
+  #
+  # Groovyc accepts the following options:
+  #
+  # * :encoding          -- Encoding of source files
+  # * :verbose           -- Asks the compiler for verbose output, true when running in verbose mode.
+  # * :fork              -- Whether to execute groovyc using a spawned instance of the JVM; defaults to no
+  # * :memoryInitialSize -- The initial size of the memory for the underlying VM, if using fork mode; ignored otherwise. 
+  #                                     Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m)
+  # * :memoryMaximumSize -- The maximum size of the memory for the underlying VM, if using fork mode; ignored otherwise. 
+  #                                     Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m)
+  # * :listfiles         -- Indicates whether the source files to be compiled will be listed; defaults to no
+  # * :stacktrace        -- If true each compile error message will contain a stacktrace
+  # * :warnings          -- Issue warnings when compiling.  True when running in verbose mode.
+  # * :debug             -- Generates bytecode with debugging information.  Set from the debug
+  #                                     environment variable/global option.
+  # * :deprecation       -- If true, shows deprecation messages.  False by default.
+  # * :optimise          -- Generates faster bytecode by applying optimisations to the program.
+  # * :source            -- Source code compatibility.
+  # * :target            -- Bytecode compatibility.
+  # * :javac             -- Hash of options passed to the ant javac task
+  #
+  class Groovyc < Base
+    
+    # The groovyc compiler jars are added to classpath at load time,
+    # if you want to customize artifact versions, you must set them on the
+    #
+    #      artifact_ns['Buildr::Compiler::Groovyc'].groovy = '1.5.4'
+    #
+    # namespace before this file is required.
+    REQUIRES = ArtifactNamespace.for(self) do |ns|
+      ns.groovy!       'org.codehaus.groovy:groovy:jar:>=1.5.3'
+      ns.commons_cli!  'commons-cli:commons-cli:jar:>=1.0'
+      ns.asm!          'asm:asm:jar:>=2.2'
+      ns.antlr!        'antlr:antlr:jar:>=2.7.7'
+    end
+    
+    ANT_TASK = 'org.codehaus.groovy.ant.Groovyc'
+    GROOVYC_OPTIONS = [:encoding, :verbose, :fork, :memoryInitialSize, :memoryMaximumSize, :listfiles, :stacktrace]
+    JAVAC_OPTIONS = [:optimise, :warnings, :debug, :deprecation, :source, :target, :javac]
+    OPTIONS = GROOVYC_OPTIONS + JAVAC_OPTIONS
+
+    class << self
+      def dependencies #:nodoc:
+        REQUIRES.artifacts
+      end
+
+      def applies_to?(project, task) #:nodoc:
+        paths = task.sources + [sources].flatten.map { |src| Array(project.path_to(:source, task.usage, src.to_sym)) }
+        paths.flatten!
+        # Just select if we find .groovy files
+        paths.any? { |path| !Dir["#{path}/**/*.groovy"].empty? }
+      end
+    end
+    
+    Java.classpath << dependencies
+    
+    specify :language => :groovy, :sources => [:groovy, :java], :source_ext => [:groovy, :java], 
+            :target => 'classes', :target_ext => 'class', :packaging => :jar
+
+    def initialize(project, options) #:nodoc:
+      super
+      options[:debug] = Buildr.options.debug if options[:debug].nil?
+      options[:deprecation] ||= false
+      options[:optimise] ||= false
+      options[:verbose] ||= Buildr.application.options.trace if options[:verbose].nil?
+      options[:warnings] = verbose if options[:warnings].nil?
+      options[:javac] = OpenObject.new if options[:javac].nil?
+    end
+
+    # http://groovy.codehaus.org/The+groovyc+Ant+Task
+    def compile(sources, target, dependencies) #:nodoc:
+      return if Buildr.application.options.dryrun
+      Buildr.ant 'groovyc' do |ant|
+        classpath = dependencies | self.class.dependencies.map(&:to_s)
+        ant.taskdef :name => 'groovyc', :classname => ANT_TASK, :classpath => classpath.join(File::PATH_SEPARATOR)
+        ant.groovyc groovyc_options(sources, target) do
+          sources.each { |src| ant.src :path => src }
+          ant.classpath do
+            classpath.each { |dep| ant.pathelement :path => dep }
+          end
+          ant.javac(javac_options)
+        end
+      end
+    end
+
+   private 
+    def groovyc_options(sources, target)
+      check_options options, OPTIONS
+      groovyc_options = options.to_hash.only(*GROOVYC_OPTIONS)
+      groovyc_options[:destdir] = File.expand_path(target)
+      groovyc_options
+    end
+
+    def javac_options
+      check_options options, OPTIONS
+      javac_options = options.to_hash.only(*JAVAC_OPTIONS)
+      javac_options[:optimize] = (javac_options.delete(:optimise) || false)
+      javac_options[:nowarn] = (javac_options.delete(:warnings) || verbose).to_s !~ /^(true|yes|on)$/i
+      other = javac_options.delete(:javac) || {}
+      javac_options.merge!(other)
+      javac_options
+    end
+    
+  end
+end
+
+# Groovy compiler comes first, ahead of Javac, this allows it to pick
+# projects that mix Groovy and Java code by spotting Groovy code first.
+Buildr::Compiler.compilers.unshift Buildr::Compiler::Groovyc

Modified: incubator/buildr/trunk/lib/buildr/java.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java.rb?rev=697908&r1=697907&r2=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java.rb Mon Sep 22 10:28:18 2008
@@ -15,8 +15,8 @@
 
 
 require RUBY_PLATFORM == 'java' ? 'buildr/java/jruby' : 'buildr/java/rjb'
-require 'buildr/java/compilers'
-require 'buildr/java/test_frameworks'
+require 'buildr/java/compiler'
+require 'buildr/java/tests'
 require 'buildr/java/bdd_frameworks'
 require 'buildr/java/packaging'
 require 'buildr/java/commands'

Modified: incubator/buildr/trunk/lib/buildr/java/bdd_frameworks.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/bdd_frameworks.rb?rev=697908&r1=697907&r2=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/bdd_frameworks.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/bdd_frameworks.rb Mon Sep 22 10:28:18 2008
@@ -14,30 +14,20 @@
 # the License.
 
 
-require 'buildr/java/test_frameworks'
+require 'buildr/java/tests'
 
 
 module Buildr
 
   # Mixin for test frameworks using src/spec/{lang}
-  module TestFramework::JavaBDD #:nodoc:
-    
-    class << self
-      def included(mod)
-        mod.module_eval do
-          include TestFramework::JavaTest
-          include ClassMethods
-        end
-        mod.extend ClassMethods
-        mod.bdd_dir = :spec
-        mod.lang = :java
-        super
-      end
-    end
+  class TestFramework::JavaBDD < TestFramework::Java #:nodoc:
 
-    module ClassMethods
-      attr_accessor :lang, :bdd_dir
+    class << self
+      attr_reader :lang, :bdd_dir
     end
+    @bdd_dir = :spec
+    @lang = :java
+    attr_accessor :lang, :bdd_dir
 
     def initialize(task, options)
       self.bdd_dir = self.class.bdd_dir
@@ -56,9 +46,8 @@
   end
   
   
-  class RSpec < TestFramework::Base
-    include TestFramework::JavaBDD
-    self.lang = :ruby
+  class RSpec < TestFramework::JavaBDD
+    @lang = :ruby
   
     TESTS_PATTERN = [ /_spec.rb$/ ]
     OPTIONS = [:properties, :java_args]
@@ -110,9 +99,8 @@
 
   end
 
-  class JtestR < TestFramework::Base
-    include TestFramework::JavaBDD
-    self.lang = :ruby
+  class JtestR < TestFramework::JavaBDD
+    @lang = :ruby
   end
 
   
@@ -127,8 +115,7 @@
   # Support the following options:
   # * :properties -- Hash of properties to the test suite
   # * :java_args -- Arguments passed to the JVM
-  class JBehave < TestFramework::Base
-    include TestFramework::JavaBDD
+  class JBehave < TestFramework::JavaBDD
 
     VERSION = "1.0.1" unless const_defined?('VERSION')
     TESTS_PATTERN = [ /Behaviou?r$/ ] #:nodoc:
@@ -191,9 +178,8 @@
   # * :format -- Report format :txt or :xml, default is :txt
   # * :properties -- Hash of properties passed to the test suite.
   # * :java_args -- Arguments passed to the JVM.
-  class EasyB < TestFramework::Base
-    include TestFramework::JavaBDD
-    self.lang = :groovy
+  class EasyB < TestFramework::JavaBDD
+    @lang = :groovy
 
     VERSION = "0.7" unless const_defined?(:VERSION)
     TESTS_PATTERN = [ /(Story|Behavior).groovy$/ ]

Copied: incubator/buildr/trunk/lib/buildr/java/compiler.rb (from r697907, incubator/buildr/trunk/lib/buildr/java/compilers.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/compiler.rb?p2=incubator/buildr/trunk/lib/buildr/java/compiler.rb&p1=incubator/buildr/trunk/lib/buildr/java/compilers.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/compilers.rb (original)
+++ incubator/buildr/trunk/lib/buildr/java/compiler.rb Mon Sep 22 10:28:18 2008
@@ -89,88 +89,7 @@
       end
 
     end
-
-
-    # Scalac compiler:
-    #   compile.using(:scalac)
-    # Used by default if .scala files are found in the src/main/scala directory (or src/test/scala)
-    # and sets the target directory to target/classes (or target/test/classes).
-    #
-    # Accepts the following options:
-    # * :warnings    -- Generate warnings if true (opposite of -nowarn).
-    # * :deprecation -- Output source locations where deprecated APIs are used.
-    # * :optimise    -- Generates faster bytecode by applying optimisations to the program.
-    # * :target      -- Class file compatibility with specified release.
-    # * :debug       -- Generate debugging info.
-    # * :other       -- Array of options to pass to the Scalac compiler as is, e.g. -Xprint-types
-    class Scalac < Base
-      class << self
-        def scala_home
-          @home ||= ENV['SCALA_HOME']
-        end
-
-        def dependencies
-          [ 'scala-library.jar', 'scala-compiler.jar'].map { |jar| File.expand_path("lib/#{jar}", scala_home) }
-        end
-
-        def use_fsc
-          ENV["USE_FSC"] =~ /^(yes|on|true)$/i
-        end
-      end
-
-      OPTIONS = [:warnings, :deprecation, :optimise, :target, :debug, :other]
-      Java.classpath << dependencies
-
-      specify :language=>:scala, :target=>'classes', :target_ext=>'class', :packaging=>:jar
-
-      def initialize(project, options) #:nodoc:
-        super
-        options[:debug] = Buildr.options.debug if options[:debug].nil?
-        options[:warnings] = verbose if options[:warnings].nil?
-        options[:deprecation] ||= false
-        options[:optimise] ||= false
-      end
-
-      def compile(sources, target, dependencies) #:nodoc:
-        check_options options, OPTIONS
-
-        cmd_args = []
-        cmd_args << '-classpath' << (dependencies + Scalac.dependencies).join(File::PATH_SEPARATOR)
-        source_paths = sources.select { |source| File.directory?(source) }
-        cmd_args << '-sourcepath' << source_paths.join(File::PATH_SEPARATOR) unless source_paths.empty?
-        cmd_args << '-d' << File.expand_path(target)
-        cmd_args += scalac_args
-        cmd_args += files_from_sources(sources)
-
-        unless Buildr.application.options.dryrun
-          Scalac.scala_home or fail 'Are we forgetting something? SCALA_HOME not set.'
-          trace((['scalac'] + cmd_args).join(' '))
-          if Scalac.use_fsc
-            system(([File.expand_path('bin/fsc', Scalac.scala_home)] + cmd_args).join(' ')) or
-              fail 'Failed to compile, see errors above'
-          else
-            Java.load
-            Java.scala.tools.nsc.Main.process(cmd_args.to_java(Java.java.lang.String))
-            fail 'Failed to compile, see errors above' if Java.scala.tools.nsc.Main.reporter.hasErrors
-          end
-        end
-      end
-
-    private
-
-      # Returns Scalac command line arguments from the set of options.
-      def scalac_args #:nodoc:
-        args = []
-        args << "-nowarn" unless options[:warnings]
-        args << "-verbose" if Buildr.application.options.trace
-        args << "-g" if options[:debug]
-        args << "-deprecation" if options[:deprecation]
-        args << "-optimise" if options[:optimise]
-        args << "-target:jvm-" + options[:target].to_s if options[:target]
-        args + Array(options[:other])
-      end
-
-    end
+    
   end
 
 
@@ -423,7 +342,6 @@
 end
 
 Buildr::Compiler << Buildr::Compiler::Javac
-Buildr::Compiler << Buildr::Compiler::Scalac
 class Buildr::Project
   include Buildr::Javadoc
   include Buildr::Apt

Added: incubator/buildr/trunk/lib/buildr/java/tests.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/java/tests.rb?rev=697908&view=auto
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java/tests.rb (added)
+++ incubator/buildr/trunk/lib/buildr/java/tests.rb Mon Sep 22 10:28:18 2008
@@ -0,0 +1,324 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+
+require 'buildr/core/build'
+require 'buildr/core/compile'
+require 'buildr/java/ant'
+
+
+module Buildr
+
+  class TestFramework::Java < TestFramework::Base
+
+    class << self
+      
+      def applies_to?(project) #:nodoc:
+        project.test.compile.language == :java
+      end
+      
+    end
+    
+  private
+
+    # Add buildr utilities (JavaTestFilter) to classpath
+    Java.classpath << File.join(File.dirname(__FILE__))
+
+    # :call-seq:
+    #     filter_classes(dependencies, criteria)
+    # 
+    # Return a list of classnames that match the given criteria. 
+    # The criteria parameter is a hash that must contain at least one of:
+    #
+    # * :class_names -- List of patterns to match against class name
+    # * :interfaces -- List of java interfaces or java classes
+    # * :class_annotations -- List of annotations on class level
+    # * :method_annotations -- List of annotations on method level
+    #
+    def filter_classes(dependencies, criteria = {})
+      return [] unless task.compile.target
+      target = task.compile.target.to_s
+      candidates = Dir["#{target}/**/*.class"].
+        map { |file| Util.relative_path(file, target).ext('').gsub(File::SEPARATOR, '.') }.
+        reject { |name| name =~ /\$/ }
+      result = []
+      if criteria[:class_names]
+        result.concat candidates.select { |name| criteria[:class_names].flatten.any? { |pat| pat === name } }
+      end
+      begin
+        Java.load
+        filter = Java.org.apache.buildr.JavaTestFilter.new(dependencies.to_java(Java.java.lang.String))
+        if criteria[:interfaces]
+          filter.add_interfaces(criteria[:interfaces].to_java(Java.java.lang.String)) 
+        end
+        if criteria[:class_annotations]
+          filter.add_class_annotations(criteria[:class_annotations].to_java(Java.java.lang.String))
+        end
+        if criteria[:method_annotations]
+          filter.add_method_annotations(criteria[:method_annotations].to_java(Java.java.lang.String))
+        end
+        result.concat filter.filter(candidates.to_java(Java.java.lang.String)).map(&:to_s)
+      rescue =>ex
+        info "#{ex.class}: #{ex.message}"
+        raise
+      end
+      result.uniq
+    end
+    
+  end
+
+
+  # JMock is available when using JUnit and TestNG, JBehave.
+  module JMock
+    
+    VERSION = '1.2.0' unless const_defined?('VERSION')
+    
+    class << self
+      def version
+        Buildr.settings.build['jmock'] || VERSION
+      end
+
+      def dependencies
+        @dependencies ||= ["jmock:jmock:jar:#{version}"]
+      end
+      
+    private
+      def const_missing(const)
+        return super unless const == :REQUIRES # TODO: remove in 1.5
+        Buildr.application.deprecated "Please use JMock.dependencies/.version instead of JMock::REQUIRES/VERSION"
+        dependencies
+      end
+    end    
+  end
+
+
+  # JUnit test framework, the default test framework for Java tests.
+  #
+  # Support the following options:
+  # * :fork        -- If true/:once (default), fork for each test class.  If :each, fork for each individual
+  #                   test case.  If false, run all tests in the same VM (fast, but dangerous).
+  # * :clonevm     -- If true clone the VM each time it is forked.
+  # * :properties  -- Hash of system properties available to the test case.
+  # * :environment -- Hash of environment variables available to the test case.
+  # * :java_args   -- Arguments passed as is to the JVM.
+  class JUnit < TestFramework::Java
+
+    # Used by the junit:report task. Access through JUnit#report if you want to set various
+    # options for that task, for example:
+    #   JUnit.report.frames = false
+    class Report
+
+      # Parameters passed to the Ant JUnitReport task.
+      attr_reader :params
+      # True (default) to produce a report using frames, false to produce a single-page report.
+      attr_accessor :frames
+      # Directory for the report style (defaults to using the internal style).
+      attr_accessor :style_dir
+      # Target directory for generated report.
+      attr_accessor :target
+
+      def initialize
+        @params = {}
+        @frames = true
+        @target = 'reports/junit'
+      end
+
+      # :call-seq:
+      #   generate(projects, target?)
+      #
+      # Generates a JUnit report for these projects (must run JUnit tests first) into the
+      # target directory. You can specify a target, or let it pick the default one from the
+      # target attribute.
+      def generate(projects, target = @target.to_s)
+        html_in = File.join(target, 'html')
+        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_taskdef).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) }.
+              each { |path| ant.fileset(:dir=>path) { ant.include :name=>'TEST-*.xml' }  }
+            options = { :format=>frames ? 'frames' : 'noframes' }
+            options[:styledir] = style_dir if style_dir
+            ant.report options.merge(:todir=>html_in) do
+              params.each { |key, value| ant.param :name=>key, :expression=>value }
+            end
+          end
+        end
+      end
+
+    end
+
+    # JUnit version number.
+    VERSION = '4.4' unless const_defined?('VERSION')
+
+    class << self
+      # :call-seq:
+      #    report()
+      #
+      # Returns the Report object used by the junit:report task. You can use this object to set
+      # various options that affect your report, for example:
+      #   JUnit.report.frames = false
+      #   JUnit.report.params['title'] = 'My App'
+      def report
+        @report ||= Report.new
+      end
+
+      def version
+        Buildr.settings.build['junit'] || VERSION
+      end
+      
+      def dependencies
+        @dependencies ||= ["junit:junit:jar:#{version}"]+ JMock.dependencies
+      end
+      
+      def ant_taskdef #:nodoc:
+        "org.apache.ant:ant-junit:jar:#{Ant.version}"
+      end
+      
+    private
+      def const_missing(const)
+        return super unless const == :REQUIRES # TODO: remove in 1.5
+        Buildr.application.deprecated "Please use JUnit.dependencies/.version instead of JUnit::REQUIRES/VERSION"
+        dependencies
+      end
+    end          
+
+    def tests(dependencies) #:nodoc:
+      filter_classes(dependencies, 
+                     :interfaces => %w{junit.framework.TestCase},
+                     :class_annotations => %w{org.junit.runner.RunWith},
+                     :method_annotations => %w{org.junit.Test})
+    end
+
+    def run(tests, dependencies) #:nodoc:
+      # Use Ant to execute the Junit tasks, gives us performance and reporting.
+      Buildr.ant('junit') do |ant|
+        case options[:fork]
+        when false
+          forking = {}
+        when :each
+          forking = { :fork=>true, :forkmode=>'perTest' }
+        when true, :once
+          forking = { :fork=>true, :forkmode=>'once' }
+        else
+          fail 'Option fork must be :once, :each or false.'
+        end
+        mkpath task.report_to.to_s
+
+        taskdef = Buildr.artifact(JUnit.ant_taskdef)
+        taskdef.invoke
+        ant.taskdef :name=>'junit', :classname=>'org.apache.tools.ant.taskdefs.optional.junit.JUnitTask', :classpath=>taskdef.to_s
+
+        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 }
+          (options[:environment] || []).each { |key, value| ant.env :key=>key, :value=>value }
+          Array(options[:java_args]).each { |value| ant.jvmarg :value=>value }
+          ant.formatter :type=>'plain'
+          ant.formatter :type=>'plain', :usefile=>false # log test
+          ant.formatter :type=>'xml'
+          ant.batchtest :todir=>task.report_to.to_s, :failureproperty=>'failed' do
+            ant.fileset :dir=>task.compile.target.to_s do
+              tests.each { |test| ant.include :name=>File.join(*test.split('.')).ext('class') }
+            end
+          end
+        end
+        return tests unless ant.project.getProperty('failed')
+      end
+      # But Ant doesn't tell us what went kaput, so we'll have to parse the test files.
+      tests.inject([]) do |passed, test|
+        report_file = File.join(task.report_to.to_s, "TEST-#{test}.txt")
+        if File.exist?(report_file)
+          report = File.read(report_file)
+          # The second line (if exists) is the status line and we scan it for its values.
+          status = (report.split("\n")[1] || '').scan(/(run|failures|errors):\s*(\d+)/i).
+            inject(Hash.new(0)) { |hash, pair| hash[pair[0].downcase.to_sym] = pair[1].to_i ; hash }
+          passed << test if status[:failures] == 0 && status[:errors] == 0
+        end
+        passed
+      end
+    end
+
+    namespace 'junit' do
+      desc "Generate JUnit tests report in #{report.target}"
+      task('report') do |task|
+        report.generate Project.projects
+        info "Generated JUnit tests report in #{report.target}"
+      end
+    end
+
+    task('clean') { rm_rf report.target.to_s }
+
+  end
+
+
+  # TestNG test framework.  To use in your project:
+  #   test.using :testng
+  #
+  # Support the following options:
+  # * :properties -- Hash of properties passed to the test suite.
+  # * :java_args -- Arguments passed to the JVM.
+  class TestNG < TestFramework::Java
+
+    VERSION = '5.7' unless const_defined?('VERSION')
+
+    class << self
+      def version
+        Buildr.settings.build['testng'] || VERSION
+      end
+      
+      def dependencies
+        ["org.testng:testng:jar:jdk15:#{version}"]+ JMock.dependencies
+      end  
+      
+    private
+      def const_missing(const)
+        return super unless const == :REQUIRES # TODO: remove in 1.5
+        Buildr.application.deprecated "Please use TestNG.dependencies/.version instead of TestNG::REQUIRES/VERSION"
+        dependencies
+      end
+    end          
+
+    def tests(dependencies) #:nodoc:
+      filter_classes(dependencies, 
+                     :class_annotations => %w{org.testng.annotations.Test},
+                     :method_annotations => %w{org.testng.annotations.Test})
+    end
+
+    def run(tests, dependencies) #:nodoc:
+      cmd_args = [ 'org.testng.TestNG', '-sourcedir', task.compile.sources.join(';'), '-suitename', task.send(:project).name ]
+      cmd_args << '-d' << task.report_to.to_s
+      cmd_options = { :properties=>options[:properties], :java_args=>options[:java_args],
+                      :classpath=>dependencies }
+      tests.inject([]) do |passed, test|
+        begin
+          Java::Commands.java cmd_args, '-testclass', test, cmd_options.merge(:name=>test)
+          passed << test
+        rescue
+          passed
+        end
+      end
+    end
+
+  end
+
+end # Buildr
+
+
+Buildr::TestFramework << Buildr::JUnit
+Buildr::TestFramework << Buildr::TestNG
\ No newline at end of file

Copied: incubator/buildr/trunk/lib/buildr/scala.rb (from r697907, incubator/buildr/trunk/lib/buildr/java.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/scala.rb?p2=incubator/buildr/trunk/lib/buildr/scala.rb&p1=incubator/buildr/trunk/lib/buildr/java.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/lib/buildr/java.rb (original)
+++ incubator/buildr/trunk/lib/buildr/scala.rb Mon Sep 22 10:28:18 2008
@@ -14,10 +14,6 @@
 # the License.
 
 
-require RUBY_PLATFORM == 'java' ? 'buildr/java/jruby' : 'buildr/java/rjb'
-require 'buildr/java/compilers'
-require 'buildr/java/test_frameworks'
-require 'buildr/java/bdd_frameworks'
-require 'buildr/java/packaging'
-require 'buildr/java/commands'
-require 'buildr/java/deprecated'
+require 'buildr/scala/compiler'
+require 'buildr/scala/tests'
+Object::Scala = Buildr::Scala

Added: incubator/buildr/trunk/lib/buildr/scala/compiler.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/scala/compiler.rb?rev=697908&view=auto
==============================================================================
--- incubator/buildr/trunk/lib/buildr/scala/compiler.rb (added)
+++ incubator/buildr/trunk/lib/buildr/scala/compiler.rb Mon Sep 22 10:28:18 2008
@@ -0,0 +1,109 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+require 'buildr/core/project'
+require 'buildr/core/common'
+require 'buildr/core/compile'
+require 'buildr/packaging'
+
+
+module Buildr::Scala
+    
+  # Scalac compiler:
+  #   compile.using(:scalac)
+  # Used by default if .scala files are found in the src/main/scala directory (or src/test/scala)
+  # and sets the target directory to target/classes (or target/test/classes).
+  #
+  # Accepts the following options:
+  # * :warnings    -- Generate warnings if true (opposite of -nowarn).
+  # * :deprecation -- Output source locations where deprecated APIs are used.
+  # * :optimise    -- Generates faster bytecode by applying optimisations to the program.
+  # * :target      -- Class file compatibility with specified release.
+  # * :debug       -- Generate debugging info.
+  # * :other       -- Array of options to pass to the Scalac compiler as is, e.g. -Xprint-types
+  class Scalac < Buildr::Compiler::Base
+    class << self
+      def scala_home
+        @home ||= ENV['SCALA_HOME']
+      end
+
+      def dependencies
+        [ 'scala-library.jar', 'scala-compiler.jar'].map { |jar| File.expand_path("lib/#{jar}", scala_home) }
+      end
+
+      def use_fsc
+        ENV["USE_FSC"] =~ /^(yes|on|true)$/i
+      end
+    end
+
+    OPTIONS = [:warnings, :deprecation, :optimise, :target, :debug, :other]
+    Java.classpath << dependencies
+
+    specify :language=>:scala, :target=>'classes', :target_ext=>'class', :packaging=>:jar
+
+    def initialize(project, options) #:nodoc:
+      super
+      options[:debug] = Buildr.options.debug if options[:debug].nil?
+      options[:warnings] = verbose if options[:warnings].nil?
+      options[:deprecation] ||= false
+      options[:optimise] ||= false
+    end
+
+    def compile(sources, target, dependencies) #:nodoc:
+      check_options options, OPTIONS
+
+      cmd_args = []
+      cmd_args << '-classpath' << (dependencies + Scalac.dependencies).join(File::PATH_SEPARATOR)
+      source_paths = sources.select { |source| File.directory?(source) }
+      cmd_args << '-sourcepath' << source_paths.join(File::PATH_SEPARATOR) unless source_paths.empty?
+      cmd_args << '-d' << File.expand_path(target)
+      cmd_args += scalac_args
+      cmd_args += files_from_sources(sources)
+
+      unless Buildr.application.options.dryrun
+        Scalac.scala_home or fail 'Are we forgetting something? SCALA_HOME not set.'
+        trace((['scalac'] + cmd_args).join(' '))
+        if Scalac.use_fsc
+          system(([File.expand_path('bin/fsc', Scalac.scala_home)] + cmd_args).join(' ')) or
+            fail 'Failed to compile, see errors above'
+        else
+          Java.load
+          Java.scala.tools.nsc.Main.process(cmd_args.to_java(Java.java.lang.String))
+          fail 'Failed to compile, see errors above' if Java.scala.tools.nsc.Main.reporter.hasErrors
+        end
+      end
+    end
+
+  private
+
+    # Returns Scalac command line arguments from the set of options.
+    def scalac_args #:nodoc:
+      args = []
+      args << "-nowarn" unless options[:warnings]
+      args << "-verbose" if Buildr.application.options.trace
+      args << "-g" if options[:debug]
+      args << "-deprecation" if options[:deprecation]
+      args << "-optimise" if options[:optimise]
+      args << "-target:jvm-" + options[:target].to_s if options[:target]
+      args + Array(options[:other])
+    end
+
+  end
+    
+end
+
+# Scala compiler comes first, ahead of Javac, this allows it to pick
+# projects that mix Scala and Java code by spotting Scala code first.
+Buildr::Compiler.compilers.unshift Buildr::Scala::Scalac
\ No newline at end of file

Added: incubator/buildr/trunk/lib/buildr/scala/tests.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/lib/buildr/scala/tests.rb?rev=697908&view=auto
==============================================================================
--- incubator/buildr/trunk/lib/buildr/scala/tests.rb (added)
+++ incubator/buildr/trunk/lib/buildr/scala/tests.rb Mon Sep 22 10:28:18 2008
@@ -0,0 +1,203 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership.  The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+
+require 'buildr/core/build'
+require 'buildr/core/compile'
+require 'buildr/java/ant'
+require 'buildr/java/tests'
+
+
+module Buildr::Scala
+
+  # Scala::Specs is available when using Scala::Test
+  module ScalaSpecs
+    VERSION = '1.2.9' unless const_defined?('VERSION')
+    
+    class << self
+      def version
+        Buildr.settings.build['scala.specs'] || VERSION
+      end
+      
+      def dependencies
+        ["org.specs:specs:jar:#{version}"]
+      end  
+
+    private
+      def const_missing(const)
+        return super unless const == :REQUIRES # TODO: remove in 1.5
+        Buildr.application.deprecated "Please use Scala::Specs.dependencies/.version instead of ScalaSpecs::REQUIRES/VERSION"
+        dependencies
+      end
+    end
+  end
+
+
+  # Scala::Check is available when using Scala::Test
+  module ScalaCheck
+    VERSION = '1.3' unless const_defined?('VERSION')
+    
+    class << self
+      def version
+        Buildr.settings.build['scala.check'] || VERSION
+      end
+      
+      def dependencies
+        ["org.scalacheck:scalacheck:jar:#{version}"]
+      end  
+
+    private
+      def const_missing(const)
+        return super unless const == :REQUIRES # TODO: remove in 1.5
+        Buildr.application.deprecated "Please use Scala::Check.dependencies/.version instead of ScalaCheck::REQUIRES/VERSION"
+        dependencies
+      end
+    end
+  end
+  
+  
+  # ScalaTest framework, the default test framework for Scala tests.
+  #
+  # Support the following options:
+  # * :properties  -- Hash of system properties available to the test case.
+  # * :environment -- Hash of environment variables available to the test case.
+  # * :java_args   -- Arguments passed as is to the JVM.
+  class ScalaTest < TestFramework::Java
+
+    VERSION = '0.9.3' unless const_defined?('VERSION')
+
+    class << self
+      def version
+        Buildr.settings.build['scala.test'] || VERSION
+      end
+      
+      def dependencies
+        ["org.scalatest:scalatest:jar:#{version}"] + ScalaSpecs.dependencies +
+          ScalaCheck.dependencies + JMock.dependencies
+      end  
+
+      def applies_to?(project) #:nodoc:
+        project.test.compile.language == :scala
+      end 
+      
+    private
+      def const_missing(const)
+        return super unless const == :REQUIRES # TODO: remove in 1.5
+        Buildr.application.deprecated "Please use Scala::Test.dependencies/.version instead of ScalaTest::REQUIRES/VERSION"
+        dependencies
+      end
+    end          
+
+    # annotation-based group inclusion
+    attr_accessor :group_includes
+    
+    # annotation-based group exclusion
+    attr_accessor :group_excludes
+    
+    def initialize(test_task, options)
+      super
+      @group_includes = []
+      @group_excludes = []
+    end
+
+    def tests(dependencies) #:nodoc:
+      suites = filter_classes(dependencies, :interfaces => %w{org.scalatest.Suite})
+      # we should really filter using :class => %w{org.specs.Specification} instead of naming convention
+      specs = filter_classes(dependencies, :class_names => [/Specs?$/])
+      [suites, specs].flatten
+    end
+
+    def run(tests, dependencies) #:nodoc:
+      mkpath task.report_to.to_s
+      success = []
+      scalatest = tests.select { |t| t !~ /Specs?$/ }
+      specs = tests.select { |t| t =~ /Specs?$/ }
+
+      # Specs
+      nostacktrace = (options[:nostacktrace]) ? "-ns" : ""
+      cmd_options = { :properties => options[:properties],
+                      :java_args => options[:java_args],
+                      :classpath => dependencies}
+      specs.each do |spec|
+        Java.load
+        begin
+          Java::Commands.java(spec, cmd_options)
+        rescue => e
+          print e.message
+        else
+          success << spec
+        end
+      end
+
+      # ScalaTest
+      reporter_options = 'TFGBSAR' # testSucceeded, testFailed, testIgnored, suiteAborted, runStopped, runAborted, runCompleted
+      scalatest.each do |suite|
+        info "ScalaTest #{suite.inspect}"
+        # Use Ant to execute the ScalaTest task, gives us performance and reporting.
+        reportFile = File.join(task.report_to.to_s, "TEST-#{suite}.txt")
+        taskdef = Buildr.artifacts(self.class.dependencies).each(&:invoke).map(&:to_s)
+        Buildr.ant('scalatest') do |ant|
+          ant.taskdef :name=>'scalatest', :classname=>'org.scalatest.tools.ScalaTestTask',
+            :classpath=>taskdef.join(File::PATH_SEPARATOR)
+          ant.scalatest :runpath=>dependencies.join(File::PATH_SEPARATOR) do
+            ant.suite    :classname=>suite
+            ant.reporter :type=>'stdout', :config=>reporter_options
+            ant.reporter :type=>'file', :filename=> reportFile, :config=>reporter_options
+            ant.includes group_includes.join(" ") if group_includes
+            ant.excludes group_excludes.join(" ") if group_excludes
+            (options[:properties] || []).each { |name, value| ant.property :name=>name, :value=>value }
+          end
+        end
+        
+        # Parse for failures, errors, etc.
+        # This is a bit of a pain right now because ScalaTest doesn't flush its
+        # output synchronously before the Ant test finishes so we have to loop 
+        # and wait for an indication that the test run was completed. 
+        failed = false
+        completed = false
+        wait = 0
+        while (!completed) do
+          File.open(reportFile, "r") do |input|
+            while (line = input.gets) do
+              failed = (line =~ /(TEST FAILED -)|(RUN STOPPED)|(RUN ABORTED)/) unless failed
+              completed |= (line =~ /Run completed\./)
+              break if (failed || completed)
+            end
+          end
+          wait += 1
+          break if (failed || wait > 10) 
+          unless completed
+            sleep(1)
+          end
+        end
+        success << suite if (completed && !failed)
+      end
+      
+      success
+    end # run
+
+  end # ScalaTest
+  
+end
+
+
+# Backwards compatibility stuff.  Remove in 1.5.
+module Buildr
+  ScalaSpecs = Scala::ScalaSpecs
+  ScalaCheck = Scala::ScalaCheck
+  ScalaTest = Scala::ScalaTest
+end
+
+Buildr::TestFramework << Buildr::Scala::ScalaTest
\ No newline at end of file

Copied: incubator/buildr/trunk/spec/addon/cobertura_spec.rb (from r697907, incubator/buildr/trunk/spec/cobertura_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/addon/cobertura_spec.rb?p2=incubator/buildr/trunk/spec/addon/cobertura_spec.rb&p1=incubator/buildr/trunk/spec/cobertura_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/cobertura_spec.rb (original)
+++ incubator/buildr/trunk/spec/addon/cobertura_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,9 +14,8 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
 require File.join(File.dirname(__FILE__), 'test_coverage_spec')
-Sandbox.require_addon File.join(File.dirname(__FILE__), '../addon', 'buildr/cobertura')
+Sandbox.require_addon 'buildr/cobertura'
 
 Buildr::Cobertura::requires
 

Copied: incubator/buildr/trunk/spec/addon/emma_spec.rb (from r697907, incubator/buildr/trunk/spec/emma_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/addon/emma_spec.rb?p2=incubator/buildr/trunk/spec/addon/emma_spec.rb&p1=incubator/buildr/trunk/spec/emma_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/emma_spec.rb (original)
+++ incubator/buildr/trunk/spec/addon/emma_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,9 +14,9 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
 require File.join(File.dirname(__FILE__), 'test_coverage_spec')
-Sandbox.require_addon File.join(File.dirname(__FILE__), '../addon', 'buildr/emma')
+Sandbox.require_addon 'buildr/emma'
+
 
 Buildr::Emma::requires
 

Copied: incubator/buildr/trunk/spec/addon/test_coverage_spec.rb (from r697907, incubator/buildr/trunk/spec/test_coverage_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/addon/test_coverage_spec.rb?p2=incubator/buildr/trunk/spec/addon/test_coverage_spec.rb&p1=incubator/buildr/trunk/spec/test_coverage_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/test_coverage_spec.rb (original)
+++ incubator/buildr/trunk/spec/addon/test_coverage_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,8 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
+
 
 module TestCoverageHelper
   def write_test options

Copied: incubator/buildr/trunk/spec/core/application_spec.rb (from r697907, incubator/buildr/trunk/spec/application_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/application_spec.rb?p2=incubator/buildr/trunk/spec/core/application_spec.rb&p1=incubator/buildr/trunk/spec/application_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/application_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/application_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe Buildr::Application do

Copied: incubator/buildr/trunk/spec/core/artifact_namespace_spec.rb (from r697907, incubator/buildr/trunk/spec/artifact_namespace_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/artifact_namespace_spec.rb?p2=incubator/buildr/trunk/spec/core/artifact_namespace_spec.rb&p1=incubator/buildr/trunk/spec/artifact_namespace_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/artifact_namespace_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/artifact_namespace_spec.rb Mon Sep 22 10:28:18 2008
@@ -13,7 +13,7 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 describe Buildr::ArtifactNamespace do
 

Copied: incubator/buildr/trunk/spec/core/build_spec.rb (from r697907, incubator/buildr/trunk/spec/build_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/build_spec.rb?p2=incubator/buildr/trunk/spec/core/build_spec.rb&p1=incubator/buildr/trunk/spec/build_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/build_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/build_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe 'local task', :shared=>true do

Copied: incubator/buildr/trunk/spec/core/checks_spec.rb (from r697907, incubator/buildr/trunk/spec/checks_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/checks_spec.rb?p2=incubator/buildr/trunk/spec/core/checks_spec.rb&p1=incubator/buildr/trunk/spec/checks_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/checks_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/checks_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe Project, " check task" do

Copied: incubator/buildr/trunk/spec/core/common_spec.rb (from r697907, incubator/buildr/trunk/spec/common_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/common_spec.rb?p2=incubator/buildr/trunk/spec/core/common_spec.rb&p1=incubator/buildr/trunk/spec/common_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/common_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/common_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 describe Buildr.method(:struct) do
   before do

Copied: incubator/buildr/trunk/spec/core/compile_spec.rb (from r697907, incubator/buildr/trunk/spec/compile_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/compile_spec.rb?p2=incubator/buildr/trunk/spec/core/compile_spec.rb&p1=incubator/buildr/trunk/spec/compile_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/compile_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/compile_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 module CompilerHelper

Copied: incubator/buildr/trunk/spec/core/project_spec.rb (from r697907, incubator/buildr/trunk/spec/project_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/project_spec.rb?p2=incubator/buildr/trunk/spec/core/project_spec.rb&p1=incubator/buildr/trunk/spec/project_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/project_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/project_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe Project do

Copied: incubator/buildr/trunk/spec/core/test_spec.rb (from r697907, incubator/buildr/trunk/spec/test_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/test_spec.rb?p2=incubator/buildr/trunk/spec/core/test_spec.rb&p1=incubator/buildr/trunk/spec/test_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/test_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/test_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 module TestHelper

Copied: incubator/buildr/trunk/spec/core/transport_spec.rb (from r697907, incubator/buildr/trunk/spec/transport_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/core/transport_spec.rb?p2=incubator/buildr/trunk/spec/core/transport_spec.rb&p1=incubator/buildr/trunk/spec/transport_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/transport_spec.rb (original)
+++ incubator/buildr/trunk/spec/core/transport_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe URI, '#download' do

Copied: incubator/buildr/trunk/spec/groovy/compiler_spec.rb (from r697907, incubator/buildr/trunk/spec/groovy_compilers_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/groovy/compiler_spec.rb?p2=incubator/buildr/trunk/spec/groovy/compiler_spec.rb&p1=incubator/buildr/trunk/spec/groovy_compilers_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/groovy_compilers_spec.rb (original)
+++ incubator/buildr/trunk/spec/groovy/compiler_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 describe 'groovyc compiler' do 
   

Copied: incubator/buildr/trunk/spec/ide/eclipse_spec.rb (from r697907, incubator/buildr/trunk/spec/eclipse_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/ide/eclipse_spec.rb?p2=incubator/buildr/trunk/spec/ide/eclipse_spec.rb&p1=incubator/buildr/trunk/spec/eclipse_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/eclipse_spec.rb (original)
+++ incubator/buildr/trunk/spec/ide/eclipse_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 module EclipseHelper

Copied: incubator/buildr/trunk/spec/java/bdd_spec.rb (from r697907, incubator/buildr/trunk/spec/java_bdd_frameworks_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java/bdd_spec.rb?p2=incubator/buildr/trunk/spec/java/bdd_spec.rb&p1=incubator/buildr/trunk/spec/java_bdd_frameworks_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java_bdd_frameworks_spec.rb (original)
+++ incubator/buildr/trunk/spec/java/bdd_spec.rb Mon Sep 22 10:28:18 2008
@@ -13,7 +13,7 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 describe Buildr::RSpec do
 

Copied: incubator/buildr/trunk/spec/java/compiler_spec.rb (from r697907, incubator/buildr/trunk/spec/java_compilers_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java/compiler_spec.rb?p2=incubator/buildr/trunk/spec/java/compiler_spec.rb&p1=incubator/buildr/trunk/spec/java_compilers_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java_compilers_spec.rb (original)
+++ incubator/buildr/trunk/spec/java/compiler_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe 'javac compiler' do

Copied: incubator/buildr/trunk/spec/java/java_spec.rb (from r697907, incubator/buildr/trunk/spec/java_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java/java_spec.rb?p2=incubator/buildr/trunk/spec/java/java_spec.rb&p1=incubator/buildr/trunk/spec/java_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java_spec.rb (original)
+++ incubator/buildr/trunk/spec/java/java_spec.rb Mon Sep 22 10:28:18 2008
@@ -13,7 +13,7 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 unless RUBY_PLATFORM =~ /java/
   describe ENV, 'JAVA_HOME on OS X' do

Copied: incubator/buildr/trunk/spec/java/packaging_spec.rb (from r697907, incubator/buildr/trunk/spec/java_packaging_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java/packaging_spec.rb?p2=incubator/buildr/trunk/spec/java/packaging_spec.rb&p1=incubator/buildr/trunk/spec/java_packaging_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java_packaging_spec.rb (original)
+++ incubator/buildr/trunk/spec/java/packaging_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,8 +14,8 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
-require File.join(File.dirname(__FILE__), 'packaging_helper')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
+require File.join(File.dirname(__FILE__), '../packaging/packaging_helper')
 
 
 describe Project, '#manifest' do

Copied: incubator/buildr/trunk/spec/java/tests_spec.rb (from r697907, incubator/buildr/trunk/spec/java_test_frameworks_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/java/tests_spec.rb?p2=incubator/buildr/trunk/spec/java/tests_spec.rb&p1=incubator/buildr/trunk/spec/java_test_frameworks_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/java_test_frameworks_spec.rb (original)
+++ incubator/buildr/trunk/spec/java/tests_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe Buildr::JUnit do

Copied: incubator/buildr/trunk/spec/packaging/archive_spec.rb (from r697907, incubator/buildr/trunk/spec/archive_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/packaging/archive_spec.rb?p2=incubator/buildr/trunk/spec/packaging/archive_spec.rb&p1=incubator/buildr/trunk/spec/archive_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/archive_spec.rb (original)
+++ incubator/buildr/trunk/spec/packaging/archive_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe 'ArchiveTask', :shared=>true do

Copied: incubator/buildr/trunk/spec/packaging/artifact_spec.rb (from r697907, incubator/buildr/trunk/spec/artifact_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/packaging/artifact_spec.rb?p2=incubator/buildr/trunk/spec/packaging/artifact_spec.rb&p1=incubator/buildr/trunk/spec/artifact_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/artifact_spec.rb (original)
+++ incubator/buildr/trunk/spec/packaging/artifact_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe Artifact do

Copied: incubator/buildr/trunk/spec/packaging/packaging_helper.rb (from r697907, incubator/buildr/trunk/spec/packaging_helper.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/packaging/packaging_helper.rb?p2=incubator/buildr/trunk/spec/packaging/packaging_helper.rb&p1=incubator/buildr/trunk/spec/packaging_helper.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
    (empty)

Copied: incubator/buildr/trunk/spec/packaging/packaging_spec.rb (from r697907, incubator/buildr/trunk/spec/packaging_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/packaging/packaging_spec.rb?p2=incubator/buildr/trunk/spec/packaging/packaging_spec.rb&p1=incubator/buildr/trunk/spec/packaging_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/packaging_spec.rb (original)
+++ incubator/buildr/trunk/spec/packaging/packaging_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 require File.join(File.dirname(__FILE__), 'packaging_helper')
 
 

Modified: incubator/buildr/trunk/spec/sandbox.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/sandbox.rb?rev=697908&r1=697907&r2=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/sandbox.rb (original)
+++ incubator/buildr/trunk/spec/sandbox.rb Mon Sep 22 10:28:18 2008
@@ -21,7 +21,9 @@
 repositories.remote << 'http://repo1.maven.org/maven2'
 repositories.remote << 'http://scala-tools.org/repo-releases'
 
-require 'buildr/java/groovyc'
+require 'buildr/groovy'
+require 'buildr/scala'
+
 Java.load # Anything added to the classpath.
 task('buildr:scala:download').invoke
 artifacts(TestFramework.frameworks.map(&:dependencies).flatten, JUnit.ant_taskdef).each { |a| file(a).invoke }

Copied: incubator/buildr/trunk/spec/scala/compiler_spec.rb (from r697907, incubator/buildr/trunk/spec/scala_compilers_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/scala/compiler_spec.rb?p2=incubator/buildr/trunk/spec/scala/compiler_spec.rb&p1=incubator/buildr/trunk/spec/scala_compilers_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/scala_compilers_spec.rb (original)
+++ incubator/buildr/trunk/spec/scala/compiler_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,7 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 
 describe 'scalac compiler' do

Copied: incubator/buildr/trunk/spec/scala/tests_spec.rb (from r697907, incubator/buildr/trunk/spec/scala_test_frameworks_spec.rb)
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/scala/tests_spec.rb?p2=incubator/buildr/trunk/spec/scala/tests_spec.rb&p1=incubator/buildr/trunk/spec/scala_test_frameworks_spec.rb&r1=697907&r2=697908&rev=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/scala_test_frameworks_spec.rb (original)
+++ incubator/buildr/trunk/spec/scala/tests_spec.rb Mon Sep 22 10:28:18 2008
@@ -14,8 +14,7 @@
 # the License.
 
 
-require File.join(File.dirname(__FILE__), 'spec_helpers')
-
+require File.join(File.dirname(__FILE__), '../spec_helpers')
 
 # TODO's
 #  -test w/ Specs
@@ -28,7 +27,7 @@
 #  -test exclude Suite's
 
 
-describe Buildr::ScalaTest do
+describe Buildr::Scala::ScalaTest do
   it 'should be the default test framework when test cases are in Scala' do
     write 'src/test/scala/com/example/MySuite.scala', <<-SCALA
       package com.example
@@ -53,26 +52,26 @@
 
   it 'should include Scalatest dependencies' do
     define('foo') { test.using(:scalatest) }
-    project('foo').test.compile.dependencies.should include(*artifacts(ScalaTest::REQUIRES))
-    project('foo').test.dependencies.should include(*artifacts(ScalaTest::REQUIRES))
+    project('foo').test.compile.dependencies.should include(*artifacts(Scala::ScalaTest.dependencies))
+    project('foo').test.dependencies.should include(*artifacts(Scala::ScalaTest.dependencies))
   end
 
   it 'should include JMock dependencies' do
     define('foo') { test.using(:scalatest) }
-    project('foo').test.compile.dependencies.should include(*artifacts(JMock::REQUIRES))
-    project('foo').test.dependencies.should include(*artifacts(JMock::REQUIRES))
+    project('foo').test.compile.dependencies.should include(*artifacts(JMock.dependencies))
+    project('foo').test.dependencies.should include(*artifacts(JMock.dependencies))
   end
-
+  
   it 'should include Specs dependencies' do
     define('foo') { test.using(:scalatest) }
-    project('foo').test.compile.dependencies.should include(*artifacts(ScalaSpecs::REQUIRES))
-    project('foo').test.dependencies.should include(*artifacts(ScalaSpecs::REQUIRES))
+    project('foo').test.compile.dependencies.should include(*artifacts(Scala::ScalaSpecs.dependencies))
+    project('foo').test.dependencies.should include(*artifacts(Scala::ScalaSpecs.dependencies))
   end
 
   it 'should include ScalaCheck dependencies' do
     define('foo') { test.using(:scalatest) }
-    project('foo').test.compile.dependencies.should include(*artifacts(ScalaCheck::REQUIRES))
-    project('foo').test.dependencies.should include(*artifacts(ScalaCheck::REQUIRES))
+    project('foo').test.compile.dependencies.should include(*artifacts(Scala::ScalaCheck.dependencies))
+    project('foo').test.dependencies.should include(*artifacts(Scala::ScalaCheck.dependencies))
   end
 
   it 'should include public classes extending org.scalatest.FunSuite' do

Modified: incubator/buildr/trunk/spec/spec_helpers.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/spec_helpers.rb?rev=697908&r1=697907&r2=697908&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/spec_helpers.rb (original)
+++ incubator/buildr/trunk/spec/spec_helpers.rb Mon Sep 22 10:28:18 2008
@@ -19,7 +19,7 @@
 unless self.class.const_defined?('SpecHelpers')
 
   require 'rubygems'
-  $LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__))
+  $LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__)), File.expand_path('../addon', File.dirname(__FILE__))
   require 'buildr'
 
   require File.expand_path('sandbox', File.dirname(__FILE__))



Mime
View raw message