-
-
Save lpellegr/b023d7b9637d118ac7f3 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