The simplest solution is to use joint compilation. Either put both Java and
Groovy code into src/main/groovy, or add the following configuration:

sourceSets.main.java.srcDirs = []
sourceSets.main.groovy.srcDir 'src/main/java'

In both cases, groovyc will now be in charge of compiling both Java and
Groovy code.

--
Peter Niederwieser
Principal Engineer, Gradleware 
http://gradleware.com
Creator, Spock Framework 
http://spockframework.org
Twitter: @pniederw

PS: http://forums.gradle.org is now the preferred place to ask questions.


David Kowis wrote
> 
> Since I last messed with gradle and our project, we've used a lot more
> groovy. I've got a class in groovy that's being used by java classes.
> Unfortunately due to the cycle defined in
> http://gradle.org/groovy_plugin , the groovy compilation happens after
> the java compilation, and so the java compilation fails not being able
> to find the class.
> 
> Whats the best way to go about resolving this? Change the dependency
> order of the groovy plugin? Or will it then have problems because the
> java doesn't exist yet?
> 
> I assume the "joint compilation" will be necessary to make this actually
> work, but I'm not sure. I'm also not sure what the best convention is to
> do in this case.
> 
> Thanks,
> David
> 


--
View this message in context: 
http://gradle.1045684.n5.nabble.com/Problem-building-groovy-test-code-tp5012007p5012511.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to