Last active
January 9, 2020 05:45
-
-
Save alex-shpak/ce48c3a25f6d8d669f84 to your computer and use it in GitHub Desktop.
Gradle script for querydsl-apt processor with separate classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// apply plugin: 'idea' | |
sourceSets { | |
generated.java | |
main.java.srcDirs += generated.java.srcDirs | |
} | |
configurations { | |
querydslapt | |
} | |
dependencies { | |
querydslapt "com.querydsl:querydsl-apt:$querydslVersion" | |
} | |
task querydsl(type: JavaCompile, group: 'build', description: 'Generate the QueryDSL query types') { | |
source = sourceSets.main.java | |
classpath = configurations.compile + configurations.querydslapt | |
options.compilerArgs = [ | |
'-proc:only', //only annotations | |
'-processor', 'com.querydsl.apt.morphia.MorphiaAnnotationProcessor' | |
] | |
destinationDir = sourceSets.generated.java.srcDirs.iterator().next() | |
} | |
compileJava.dependsOn querydsl | |
clean { | |
delete sourceSets.generated.java.srcDirs | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks a lot!
It was the only hint I could find on integrating custom annotation processor!