Created
April 13, 2013 06:59
-
-
Save edwardbeckett/5377401 to your computer and use it in GitHub Desktop.
mysema.querydsl gradle
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
sourceSets { | |
generated { | |
java { | |
srcDirs = ['src/main/generated'] | |
} | |
} | |
} | |
configurations { | |
querydslapt | |
} | |
dependencies { | |
compile 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final' | |
compile "com.mysema.querydsl:querydsl-jpa:$querydslVersion" | |
querydslapt "com.mysema.querydsl:querydsl-apt:$querydslVersion" | |
} | |
task generateQueryDSL(type: JavaCompile, group: 'build', description: 'Generates the QueryDSL query types') { | |
source = sourceSets.main.java | |
classpath = configurations.compile + configurations.querydslapt | |
options.compilerArgs = [ | |
"-proc:only", | |
"-processor", "com.mysema.query.apt.jpa.JPAAnnotationProcessor" | |
] | |
destinationDir = sourceSets.generated.java.srcDirs.iterator().next() | |
} | |
compileJava { | |
dependsOn generateQueryDSL | |
source generateQueryDSL.destinationDir | |
} | |
compileGeneratedJava { | |
dependsOn generateQueryDSL | |
options.warnings = false | |
classpath += sourceSets.main.runtimeClasspath | |
} | |
clean { | |
delete sourceSets.generated.java.srcDirs | |
} | |
idea { | |
module { | |
sourceDirs += file('src/main/generated') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thx a lot!! very useful infomation