Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add apt output dir as source directly in sourcesJar task
Code generation and subsequent compilation is performed within a single java compiler call. Gradle, on the other hand, checks whether the inputs of a task have changed before starting the task. So if we call compileJava for the first time after cleaning build dir before starting the task, Gradle sees that generatedSrcDir is empty and remembers that. When we call compileJava again, Gradle sees that new files have been added to generatedSrcDir and restarts compilation. On the third compileJava call in a row, nothing has changed for Gradle and it marks the task as up to date. As far as I understand, adding generatedSrcDir as sourceSet is only needed to include generated sources in sourcesJar. So instead of adding generatedSrcDir as sourceSet, we can add it directly to sourcesJar. Signed-off-by: Denis Buzmakov <me@bacecek.dev>
- Loading branch information