Managing generated code


(Juan Valencia) #1

What’s the best way to manage generated code.

I can script it to compile, but then the IDE plugins won’t pick it up very easily. Several threads address how to work with it, but is there a concensus on best practice?


(Peter Niederwieser) #2

For IntelliJ and Eclipse, a common pattern is to generate the code in Gradle, and add the generator’s output directory as an additional source directory to the appropriate source set (say ‘sourceSets.main’). Then IDEs should pick up the sources as well.