On 23/04/10 10:08 AM, Roger Studner wrote:
This is a problem i'm sure has been solved over and over.. I just can't =
find it via da googles :)

src
main
  java
   com
    AClass
    BClass
  groovy
   com
    SomeOtherClass

SomeOtherClass refers to AClass.. but BClass refers to SomeOtherClass

Since it performs compileJava and then compileGroovy, it is a chicken =
and egg problem.

Right now I solve this by putting 100% of my code under src/main/groovy


This is what the groovy plugin convention expects, which may or may not be a good idea.

You can do something like this, so you can put java source under src/main/java and groovy source under src/main/groovy, and still get the joint compilation:

sourceSets.main.java.srcDirs = [] // ie there's no stand-alone java source
sourceSets.main.groovy.srcDir 'src/main/java' // ie include the 'java' dir as groovy source

It's a little awkward.

Perhaps it would be better if you could declare dependencies between source sets, something like:

sourceSets.main {
    java {
        dependsOn groovy // a cycle -> Gradle does joint compilation
    }
    groovy {
        dependsOn java  // this is the default
    }
}

Or perhaps if you could add one source set to another, something like:

sourceSets.main {
    groovy {
        from java // include in joint compilation
    }
}


--
Adam Murdoch
Gradle Developer
http://www.gradle.org


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

   http://xircles.codehaus.org/manage_email


Reply via email to