I have a project that makes use of an annotation to generate java source code (to those who are curious, its a GWT-Platform annotation – @GenDispatch). I store those generated sources to the src/gen/java directory. The rest of the non-autogenerated sources are in src/main/java.
Here’s how I build the project: 1. compile the project with the compile arg: “-s src/gen/java” to generate the source code. 2. compile the project with compile arg: “-proc:none” to disable source generation by the annotation. The idea is just to compile the code generated in step 1 and the code in src/main/java
Step 1 above finishes without errors. The problem comes in step 2. I get a “cannot find symbol” compile error pertaining to the java source code generated in step 1.
Here’s the pertinent snippet from my build.gradle file:
sourceCompatibility = 1.6
compilerArgs = [’-s’, ‘src/main/gen’]
destinationDir = sourceSets.main.classesDir }
compilerArgs = [’-proc:none’]
source = [sourceSets.gen.allJava.srcDirs, sourceSets.main.allJava.srcDirs] }
Any idea what’s wrong with this?