diff --git a/build.gradle b/build.gradle index bef4ba8f87..72490ce0f8 100644 --- a/build.gradle +++ b/build.gradle @@ -173,22 +173,27 @@ subprojects { subProject -> ext.aptGeneratedSourceDir = file( "${buildDir}/generated-src/apt/${name}" ) } + ext.standardJavacOptions = [ + "-nowarn", + "-encoding", "UTF-8", + "-source", rootProject.javaLanguageLevel, + "-target", rootProject.javaLanguageLevel + ] + tasks.withType( JavaCompile.class ).all { task-> task.options.define( - compilerArgs: [ - "-nowarn", - "-encoding", "UTF-8", - "-source", rootProject.javaLanguageLevel, - "-target", rootProject.javaLanguageLevel, - ] + compilerArgs: standardJavacOptions ) } + ext.jbossLoggingToolClass = "org.jboss.logging.processor.apt.LoggingToolsProcessor" + // alter the compileJava (src/main/java javac task) to add JBoss Logging AP hooks compileJava { classpath += configurations.jbossLoggingTool options.compilerArgs += [ + "-processor", jbossLoggingToolClass, "-s", "$sourceSets.main.aptGeneratedSourceDir.absolutePath", "-Adebug=true", "-AskipTranslations=true", diff --git a/hibernate-entitymanager/hibernate-entitymanager.gradle b/hibernate-entitymanager/hibernate-entitymanager.gradle index 9114d494bc..3e18bc65a2 100644 --- a/hibernate-entitymanager/hibernate-entitymanager.gradle +++ b/hibernate-entitymanager/hibernate-entitymanager.gradle @@ -74,6 +74,7 @@ compileTestJava { classpath += configurations.hibernateJpaModelGenTool options.compilerArgs += [ + "-processor", "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor", "-s", "$sourceSets.test.aptGeneratedSourceDir.absolutePath" ] diff --git a/hibernate-envers/hibernate-envers.gradle b/hibernate-envers/hibernate-envers.gradle index 88f855fcd9..644207dfdd 100644 --- a/hibernate-envers/hibernate-envers.gradle +++ b/hibernate-envers/hibernate-envers.gradle @@ -32,8 +32,10 @@ def pomDescription() { sourceSets { test { - ext.enversDemoJavaDir = file( "src/demo/java" ) - ext.enversDemoResourcesDir = file( "src/demo/resources" ) + ext { + enversDemoJavaDir = file( "src/demo/java" ) + enversDemoResourcesDir = file( "src/demo/resources" ) + } java { srcDir enversDemoJavaDir } @@ -45,6 +47,11 @@ sourceSets { compileJava { classpath += configurations.hibernateJpaModelGenTool + + + options.compilerArgs += [ + "-processor", "$jbossLoggingToolClass,org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor" + ] } jar {