-
-
Save marsyang1/71aa99b375d68b642f79504e01e2c835 to your computer and use it in GitHub Desktop.
Gradle script for querydsl-apt processor with separate classpath
This file contains hidden or 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 | |
} | |
idea { | |
module { | |
sourceDirs += file('src/main/generated') | |
} | |
} | |
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.mysema.query.apt.jpa.JPAAnnotationProcessor' | |
] | |
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