HHH-7184 - Envers revision entity JPA2 metadata

This commit is contained in:
Lukasz Antoniak 2012-03-18 15:53:04 +01:00
parent 71db4095c6
commit ecd8ad5446
1 changed files with 25 additions and 0 deletions

View File

@ -27,9 +27,34 @@ sourceSets {
srcDir 'src/matrix/java'
}
}
main {
generatedJpaMetamodelSrcDir = file( "${buildDir}/generated-src/jpamodelgen/${name}" )
java {
srcDir generatedJpaMetamodelSrcDir
}
}
}
compileMatrixJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"])
// Generate JPA2 static metamodel for default revision entities
task generateJpaMetamodelClasses(type: Compile) {
classpath = compileJava.classpath + configurations.hibernateJpaModelGenTool
source = sourceSets.main.originalJavaSrcDirs
destinationDir = file( buildDirName + "/tmp/apt" )
options.define(
compilerArgs: [
"-proc:only",
"-processor", "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor",
"-s", "$sourceSets.main.generatedJpaMetamodelSrcDir.absolutePath"
]
);
outputs.dir sourceSets.main.generatedJpaMetamodelSrcDir;
doFirst {
sourceSets.main.generatedJpaMetamodelSrcDir.mkdirs()
}
}
compileJava.dependsOn generateJpaMetamodelClasses
idea {
module {
testSourceDirs += file( 'src/matrix/java')