The JavaToJavaccDependencyAction class adds the generated javacc output to all source roots. This is undesirable for me, if I have multiple source roots, because now I will have the class files (compiled from javacc output) everywhere which creates duplicates when packaging them together into the same jar.
Also, doing this in the afterEvaluate is fragile since configurations might happen afterwards (i.e., the plugin should rely on the Provider API of Gradle even if it does this).
Anyway, this automatic addition of source roots should be optional, or the very least, it should be possible to opt-out.
The
JavaToJavaccDependencyAction
class adds the generated javacc output to all source roots. This is undesirable for me, if I have multiple source roots, because now I will have the class files (compiled from javacc output) everywhere which creates duplicates when packaging them together into the same jar.Also, doing this in the
afterEvaluate
is fragile since configurations might happen afterwards (i.e., the plugin should rely on theProvider
API of Gradle even if it does this).Anyway, this automatic addition of source roots should be optional, or the very least, it should be possible to opt-out.