buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Boisvert <alex.boisv...@gmail.com>
Subject Re: scala questions
Date Fri, 27 May 2011 22:27:37 GMT
On Thu, May 26, 2011 at 6:18 PM, Alexis Midon <alexismidon@gmail.com> wrote:

> It works fine except that you have to explicitly add scalatest to your test
> classpath.
>
>
>      define 'scala-sample', :layout => server_layout do
>        package :jar
>        test.using :junit
>        test.with
> "org.scalatest:scalatest_#{Scala.version}:jar:#{Scala::ScalaTest.version}"
>      end
>
>
> I tried to have this done by the JUnit TestFramework but I don't see how to
> get access to the project language from the "dependencies" method.
> TestFramework don't know what project they are associated with.
>
> It looks that this information should be pass from outside.
> I gave a stab at a quick patch. Needs some polishing.
>
> https://github.com/alexism/buildr/commit/a40964f3e10198fadd9b6ab089010dee007d6e6a


Perhaps an after_define hook run in the ScalaTest module would be
easier/cleaner?

  after_define(:scalatest => :test) do |project|
    if (project.test.compile.language == :scala) && (project.test.framework
== :junit)
      project.test.compile.dependencies += ScalaTest.dependencies
    end
  end

(just a sketch, untested)

alex

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message