You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2022/02/16 07:58:14 UTC
[groovy] branch master updated (02ebb32 -> 59b5aaf)
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git.
from 02ebb32 GROOVY-10290: Dynamic Groovy code in Gradle doesn't compile because of $getLookup() method is not static
new 20d7052 GROOVY-10491: Bump jqwik to 1.6.4 (test dependency)
new cfc4a73 GROOVY-10492: Bump picocli to 4.6.3
new a0265a6 GROOVY-10493: Bump slf4j to 1.7.36 (test dependency)
new 59b5aaf add extra @PlatformLog doco
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
gradle/verification-metadata.xml | 11 +----
src/spec/doc/core-metaprogramming.adoc | 69 ++++++++++++++++++++++++-----
subprojects/groovy-test-junit5/build.gradle | 2 +-
versions.properties | 4 +-
4 files changed, 63 insertions(+), 23 deletions(-)
[groovy] 04/04: add extra @PlatformLog doco
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 59b5aaf35e3b63a5e49418a55c9b82e8a4100ae1
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Feb 16 17:58:07 2022 +1000
add extra @PlatformLog doco
---
src/spec/doc/core-metaprogramming.adoc | 69 +++++++++++++++++++++++++++++-----
1 file changed, 59 insertions(+), 10 deletions(-)
diff --git a/src/spec/doc/core-metaprogramming.adoc b/src/spec/doc/core-metaprogramming.adoc
index cb15171..235e7d6 100644
--- a/src/spec/doc/core-metaprogramming.adoc
+++ b/src/spec/doc/core-metaprogramming.adoc
@@ -2116,13 +2116,12 @@ Deprecated. Consider using traits instead.
==== Logging improvements
-Groovy provides AST transformation that helps integrating with the most widely used logging frameworks. It's worth noting
-that annotating a class with one of those annotations doesn't prevent you from adding the appropriate logging framework
-on classpath.
+Groovy provides a family of AST transformations that help with integration of the most widely
+used logging frameworks. There is a transform and associated annotation for each of the common frameworks.
+These transforms provide a streamlined declarative approach to using the logging framework.
+In each case, the transform will:
-All transformations work in a similar way:
-
-* add static final `log` field corresponding to the logger
+* add a static final `log` field to the annotated class corresponding to the logger
* wrap all calls to `log.level()` into the appropriate `log.isLevelEnabled` guard, depending on the underlying framework
Those transformations support two parameters:
@@ -2130,6 +2129,9 @@ Those transformations support two parameters:
* `value` (default `log`) corresponds to the name of the logger field
* `category` (defaults to the class name) is the name of the logger category
+It's worth noting that annotating a class with one of those annotations doesn't
+prevent you from using the logging framework using the normal long-hand approach.
+
[[xform-Log]]
===== `@groovy.util.logging.Log`
@@ -2150,7 +2152,7 @@ include::../test/LogImprovementsASTTransformsTest.groovy[tags=log_equiv,indent=0
[[xform-Commons]]
===== `@groovy.util.logging.Commons`
-Groovy supports the http://commons.apache.org/proper/commons-logging/[Apache Commons Logging] framework using to the
+Groovy supports the http://commons.apache.org/proper/commons-logging/[Apache Commons Logging] framework using the
`@Commons` annotation. Writing:
[source,groovy]
@@ -2165,10 +2167,12 @@ is equivalent to writing:
include::../test/LogImprovementsASTTransformsTest.groovy[tags=commons_equiv,indent=0]
----
+You still need to add the appropriate commons-logging jar to your classpath.
+
[[xform-Log4j]]
===== `@groovy.util.logging.Log4j`
-Groovy supports the http://logging.apache.org/log4j/1.2/[Apache Log4j 1.x] framework using to the
+Groovy supports the http://logging.apache.org/log4j/1.2/[Apache Log4j 1.x] framework using the
`@Log4j` annotation. Writing:
[source,groovy]
@@ -2183,10 +2187,14 @@ is equivalent to writing:
include::../test/LogImprovementsASTTransformsTest.groovy[tags=log4j_equiv,indent=0]
----
+You still need to add the appropriate log4j jar to your classpath.
+This annotation can also be used with the compatible https://reload4j.qos.ch/[reload4j] log4j
+drop-in replacement, just use the jar from that project instead of a log4j jar.
+
[[xform-Log4j2]]
===== `@groovy.util.logging.Log4j2`
-Groovy supports the http://logging.apache.org/log4j/2.x/[Apache Log4j 2.x] framework using to the
+Groovy supports the http://logging.apache.org/log4j/2.x/[Apache Log4j 2.x] framework using the
`@Log4j2` annotation. Writing:
[source,groovy]
@@ -2201,10 +2209,12 @@ is equivalent to writing:
include::../test/LogImprovementsASTTransformsTest.groovy[tags=log4j2_equiv,indent=0]
----
+You still need to add the appropriate log4j2 jar to your classpath.
+
[[xform-Slf4j]]
===== `@groovy.util.logging.Slf4j`
-Groovy supports the http://www.slf4j.org/[Simple Logging Facade for Java (SLF4J)] framework using to the
+Groovy supports the http://www.slf4j.org/[Simple Logging Facade for Java (SLF4J)] framework using the
`@Slf4j` annotation. Writing:
[source,groovy]
@@ -2219,6 +2229,45 @@ is equivalent to writing:
include::../test/LogImprovementsASTTransformsTest.groovy[tags=slf4j_equiv,indent=0]
----
+You still need to add the appropriate slf4j jar(s) to your classpath.
+
+[[xform-PlatformLog]]
+===== `@groovy.util.logging.PlatformLog`
+
+Groovy supports the https://openjdk.java.net/jeps/264[Java Platform Logging API and Service]
+framework using the `@PlatformLog` annotation. Writing:
+
+[source,groovy]
+----
+@groovy.util.logging.PlatformLog
+class Greeter {
+ void greet() {
+ log.info 'Called greeter'
+ println 'Hello, world!'
+ }
+}
+----
+
+is equivalent to writing:
+
+[source,groovy]
+----
+import java.lang.System.Logger
+import java.lang.System.LoggerFinder
+import static java.lang.System.Logger.Level.INFO
+
+class Greeter {
+ private static final transient Logger log =
+ LoggerFinder.loggerFinder.getLogger(Greeter.class.name, Greeter.class.module)
+ void greet() {
+ log.log INFO, 'Called greeter'
+ println 'Hello, world!'
+ }
+}
+----
+
+You need to be using JDK 9+ to use this capability.
+
==== Declarative concurrency
The Groovy language provides a set of annotations aimed at simplifying common concurrency patterns in a declarative
[groovy] 01/04: GROOVY-10491: Bump jqwik to 1.6.4 (test dependency)
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 20d70525ab80979e3fc144b760bae1c062f55570
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Feb 16 16:44:19 2022 +1000
GROOVY-10491: Bump jqwik to 1.6.4 (test dependency)
---
subprojects/groovy-test-junit5/build.gradle | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/subprojects/groovy-test-junit5/build.gradle b/subprojects/groovy-test-junit5/build.gradle
index 740ea4f..9484d98 100644
--- a/subprojects/groovy-test-junit5/build.gradle
+++ b/subprojects/groovy-test-junit5/build.gradle
@@ -33,7 +33,7 @@ dependencies {
exclude(group: 'org.apiguardian', module: 'apiguardian-api')
}
testImplementation "org.junit.jupiter:junit-jupiter-params:${versions.junit5}"
- testImplementation 'net.jqwik:jqwik:1.6.3'
+ testImplementation 'net.jqwik:jqwik:1.6.4'
testRuntimeOnly "org.junit.platform:junit-platform-engine:${versions.junit5Platform}"
testRuntimeOnly "org.junit.platform:junit-platform-runner:${versions.junit5Platform}"
testImplementation project(':groovy-test')
[groovy] 02/04: GROOVY-10492: Bump picocli to 4.6.3
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit cfc4a73e6a573a3a13480ce9dd18294342316242
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Feb 16 16:55:12 2022 +1000
GROOVY-10492: Bump picocli to 4.6.3
---
gradle/verification-metadata.xml | 11 +----------
versions.properties | 2 +-
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml
index 95d8524..c3a05a8 100644
--- a/gradle/verification-metadata.xml
+++ b/gradle/verification-metadata.xml
@@ -152,6 +152,7 @@
<trusted-key id="a5bd02b93e7a40482eb1d66a5f69ad087600b22c" group="org.ow2.asm"/>
<trusted-key id="a778fde933a96dda827840d8e2b3d84202b812d9" group="org.assertj"/>
<trusted-key id="a7892505cf1a58076453e52d7999befba1039e8b" group="net.bytebuddy"/>
+ <trusted-key id="aa417737bd805456db3cbdde6601e5c08dccbb96" group="info.picocli" name="picocli"/>
<trusted-key id="aaaa9d3f580c7223dbd1ff425746ee07d997ddb6" group="net.jqwik"/>
<trusted-key id="b1fc0e1fa329669191f8306f5bcee695141e6086">
<trusting group="org.jboss.weld"/>
@@ -518,16 +519,6 @@
<sha512 value="80be5adf1a1d5f182da3bc718953d0149673c43844690dea30fe00d83ea3886517e88473da48619007932047fd45e461643ec07704b3b7c5b52d798801c6066e" origin="Generated by Gradle because artifact wasn't signed"/>
</artifact>
</component>
- <component group="info.picocli" name="picocli" version="4.6.1">
- <artifact name="picocli-4.6.1.jar">
- <pgp value="8756c4f765c9ac3cb6b85d62379ce192d401ab61"/>
- </artifact>
- </component>
- <component group="info.picocli" name="picocli" version="4.6.2">
- <artifact name="picocli-4.6.2.jar">
- <pgp value="aa417737bd805456db3cbdde6601e5c08dccbb96"/>
- </artifact>
- </component>
<component group="io.github.x-stream" name="mxparser" version="1.2.1">
<artifact name="mxparser-1.2.1.jar">
<pgp value="050a37a2e0577f4baa095b52602ec18d20c4661c"/>
diff --git a/versions.properties b/versions.properties
index eb7edad..283517b 100644
--- a/versions.properties
+++ b/versions.properties
@@ -40,7 +40,7 @@ junit=4.13.2
log4j=1.2.17
log4j2=2.17.1
openbeans=1.0.2
-picocli=4.6.2
+picocli=4.6.3
qdox=1.12.1
slf4j=1.7.33
xmlunit=1.6
[groovy] 03/04: GROOVY-10493: Bump slf4j to 1.7.36 (test dependency)
Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit a0265a6200067b3cdbed600826babdd7ef92fee5
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Feb 16 17:02:49 2022 +1000
GROOVY-10493: Bump slf4j to 1.7.36 (test dependency)
---
versions.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/versions.properties b/versions.properties
index 283517b..a45c67f 100644
--- a/versions.properties
+++ b/versions.properties
@@ -42,7 +42,7 @@ log4j2=2.17.1
openbeans=1.0.2
picocli=4.6.3
qdox=1.12.1
-slf4j=1.7.33
+slf4j=1.7.36
xmlunit=1.6
xstream=1.4.19
# running with Groovy 4 can be allowed with -Dspock.iKnowWhatImDoing.disableGroovyVersionCheck=true