From 2d084cb8d9421109612b2b65548cb116be2f5b31 Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Tue, 1 Nov 2011 14:53:31 +0800 Subject: [PATCH] HHH-6787 upgrade to JBoss Logging tools 1.0.0.CR3 --- build.gradle | 17 +++++++++-------- hibernate-core/hibernate-core.gradle | 4 +++- .../hibernate/internal/CoreMessageLogger.java | 6 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 19d5fdac85..020d7914c1 100644 --- a/build.gradle +++ b/build.gradle @@ -83,9 +83,9 @@ libraries = [ jacc: 'org.jboss.spec.javax.security.jacc:jboss-jacc-api_1.4_spec:1.0.0.Final', // logging - logging: 'org.jboss.logging:jboss-logging:3.0.0.GA', - logging_generator: 'org.jboss.logging:jboss-logging-generator:1.0.0.Beta7', - logging_processor: 'org.jboss.logging:jboss-logging-processor:1.0.0.Beta7', + logging: 'org.jboss.logging:jboss-logging:3.1.0.Beta3', + logging_generator: 'org.jboss.logging:jboss-logging-generator:1.0.0.CR3', + logging_processor: 'org.jboss.logging:jboss-logging-processor:1.0.0.CR3', slf4j_api: 'org.slf4j:slf4j-api:' + slf4jVersion, slf4j_log4j12: 'org.slf4j:slf4j-log4j12:' + slf4jVersion, jcl_slf4j: 'org.slf4j:jcl-over-slf4j:' + slf4jVersion, @@ -168,20 +168,21 @@ subprojects { subProject -> } task generateMainLoggingClasses(type: Compile) { - classpath = compileJava.classpath + configurations.jbossLoggingTool - source = sourceSets.main.originalJavaSrcDirs + classpath = compileJava.classpath + configurations.jbossLoggingTool + source = sourceSets.main.originalJavaSrcDirs destinationDir = aptDumpDir - options.define( + options.define( compilerArgs: [ "-nowarn", "-proc:only", - "-encoding", "UTF-8", - "-processor", "org.jboss.logging.LoggingToolsProcessor", + "-encoding", "UTF-8", + "-processor", "org.jboss.logging.generator.apt.LoggingToolsProcessor", "-s", "$sourceSets.main.generatedLoggingSrcDir.absolutePath" ] ); outputs.dir sourceSets.main.generatedLoggingSrcDir; doFirst { + source = sourceSets.main.originalJavaSrcDirs sourceSets.main.generatedLoggingSrcDir.mkdirs() } } diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index d41bd047d8..4c63c3dca6 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -43,9 +43,9 @@ sourceSets { } } sourceSets.main { - originalJavaSrcDirs = java.srcDirs jaxbTargetDir = file( "${buildDir}/generated-src/jaxb/main" ) java.srcDir jaxbTargetDir + originalJavaSrcDirs = java.srcDirs } // resources inherently exclude sources @@ -113,6 +113,8 @@ task jaxb { } } +generateMainLoggingClasses.dependsOn jaxb +generateMainLoggingClasses.dependsOn generateGrammarSource compileJava.dependsOn jaxb diff --git a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java index a4026e3a3b..c12d333ac3 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java @@ -214,7 +214,7 @@ public interface CoreMessageLogger extends BasicLogger { void deprecatedOracleDialect(); @LogMessage(level = WARN) - @Message(value = "DEPRECATED : use {} instead with custom {} implementation", id = 65) + @Message(value = "DEPRECATED : use [%s] instead with custom [%s] implementation", id = 65) void deprecatedUuidGenerator(String name, String name2); @@ -1234,7 +1234,7 @@ public interface CoreMessageLogger extends BasicLogger { void unableToRemoveBagJoinFetch(); @LogMessage(level = INFO) - @Message(value = "Could not resolve aggregate function {}; using standard definition", id = 359) + @Message(value = "Could not resolve aggregate function [%s]; using standard definition", id = 359) void unableToResolveAggregateFunction(String name); @LogMessage(level = INFO) @@ -1498,7 +1498,7 @@ public interface CoreMessageLogger extends BasicLogger { void disablingContextualLOBCreationSinceCreateClobFailed(Throwable t); @LogMessage(level = INFO) - @Message(value = "Could not close session; swallowing exception as transaction completed", id = 425) + @Message(value = "Could not close session; swallowing exception[%s] as transaction completed", id = 425) void unableToCloseSessionButSwallowingError(HibernateException e); @LogMessage(level = WARN)