Im currently seeing a problem with incremental compilation, where I get a ‘cannot find symbol’ when compiling.
This seems to be due to the way we generate some of our code, where our models inherit eachother and the resulting generated code will have the same package and class name but exist in the different subprojects (classpath overloading). The classes are not inherited.
This is all fine when we package the softwhere, we can control the classpath.
However, sometimes when a incremental compile is needed the ‘cannot find symbol’ error occurs. I’ve looked a bit into it and it seems that the output of the previous build is added to the compile classpath, but at the end of it, hence the wrong class is loaded first (the least specialized one).
If the output of the previous build is added first to the compile classpath the compilation is successful, I’ve tried to do this here: dvaske@296edb1. But I’m a bit unsure if this is the right path.
I’ll be happy to provide a pull request for this, if it seems good.
Also raised as a issue on github: https://github.com/gradle/gradle/issues/10606