For joint compilation to work both groovy and java sources need to be in the
src/main/groovy directory.

If you have a separate src/main/java directory that holds your java sources
the sources in that directory are compiled separately.

2009/3/18 Martin Vlcek <[email protected]>

>
> Make sure that the Java-Compile task is not run, e.g. by setting
> srcDirNames
> = [].
> Set all Java and Groovy source directories in groovySrcDirNames, e.g. = [
> 'src-java', 'src-groovy' ]
>
> Martin
>
>
> Johnny Jian-2 wrote:
> >
> > I did use the groovy plugin. Here is my build.gradle file:
> >
> > usePlugin('groovy')
> >
> > sourceCompatibility = 1.5
> > targetCompatibility = 1.5
> >
> > dependencies {
> >     addMavenRepo()
> >     groovy "org.codehaus.groovy:groovy-all:1.5.6"
> >     compile "junit:junit:4.5"
> >     compile "cglib:cglib:2.2"
> >     compile "org.objenesis:objenesis:1.1"
> >     testCompile "org.hamcrest:hamcrest-library:1.1"
> > }
> >
> >
> > On Wed, Mar 18, 2009 at 1:08 AM, Tom Eyckmans <[email protected]>
> wrote:
> >
> >> Hi,
> >>
> >> You should use the groovy plugin instead of the java plugin, the groovy
> >> plugin compiles both java and groovy code.
> >>
> >> Userdoc of the groovy plugin:
> >> http://www.gradle.org/userguide/0.5.2/userguidech11.html#x31-6900011.
> >>
> >> Thx,
> >>
> >> Tom
> >>
> >> 2009/3/17 Johnny Jian <[email protected]>
> >>
> >>> Hi,
> >>>
> >>> I got compilation errors of my Java code while the Java code depends on
> >>> the Groovy code. I wonder whether gradle has joint compilation, or is
> >>> there
> >>> a switch?
> >>>
> >>> Johnny
> >>>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Does-gradle-have-joint-compilation--tp22562607p22573818.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