buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Assaf Arkin" <>
Subject Re: Groovy integration
Date Mon, 04 Feb 2008 20:15:41 GMT
On 2/3/08, Caleb Land <> wrote:
> I'm writing a project with Java and Groovy, and I was looking to use
> buildr.
> I see that there is Scala integration, but none for Groovy.
> I'm looking to build a buildr task for Groovy.
> The difference (as I see it) from using Groovy and Scala is that Groovy
> has
> what's called a joint compiler, which allows you to compile java and
> groovy
> code in one swoop, allowing your groovy to depend on java classes and vice
> versa.
> So, basically, I would like to call my groovy compiler for .java and
> .groovy
> files and skip buildr's default javac compilation. Is it possible to do
> this?

1.2.10 has a task specific for Scala, but that approach doesn't work well,
it doesn't integrate with test, IDE and other tasks.  In 1.3 we added a
framework that can use multiple compilers from the compile task, and
currently we have Java and Scala.  Adding Groovy wouldn't be a big deal, see

After a lot of playing around, the simplest approach I could find was to go
with one-language-per-project.  You can use multiple languages in the same
build, but each project configures itself to one compiler, by looking for
available source files.  So if the project has .java files, the Javac
compiler will kick in, since it's first on the list.   Next on the list is
Scalac, which only kicks in if it sees .scala files, etc.

You can work around it by writing a Groovy compiler that looks for either
Java or Groovy sources (see applies_to in Compiler::Base), by placing it
first in the list of available compilers (unshift instead of <<).


> Caleb Land

CTO, Intalio

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