Skip to content

Instantly share code, notes, and snippets.

@lpellegr
Forked from alex-shpak/querydsl.gradle
Created February 1, 2016 20:36
Show Gist options
  • Save lpellegr/b023d7b9637d118ac7f3 to your computer and use it in GitHub Desktop.
Save lpellegr/b023d7b9637d118ac7f3 to your computer and use it in GitHub Desktop.
Gradle script for querydsl-apt processor with separate classpath
// 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