From 806b1722fa9b43e96fcc4f97c75b22f0d14fa275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Sat, 18 Dec 2021 20:30:31 +0100 Subject: [PATCH] update to Java 17, Groovy 4 --- gradle.properties | 6 +++--- gradle/compile/groovy.gradle | 10 +++++----- gradle/compile/java.gradle | 8 ++++---- gradle/ide/idea.gradle | 5 ----- groovy-crypt/gradle.properties | 1 - groovy-ftp/gradle.properties | 1 - groovy-ftps/gradle.properties | 1 - groovy-git/build.gradle | 2 +- groovy-git/gradle.properties | 1 - .../internal/AnnotateAtRuntimeASTTransformation.java | 2 +- .../internal/WithOperationsASTTransformation.java | 12 ++++++++---- groovy-ldap/gradle.properties | 1 - groovy-mail/gradle.properties | 1 - groovy-sshd/gradle.properties | 1 - 14 files changed, 22 insertions(+), 30 deletions(-) delete mode 100644 groovy-crypt/gradle.properties delete mode 100644 groovy-ftp/gradle.properties delete mode 100644 groovy-ftps/gradle.properties delete mode 100644 groovy-git/gradle.properties delete mode 100644 groovy-ldap/gradle.properties delete mode 100644 groovy-mail/gradle.properties delete mode 100644 groovy-sshd/gradle.properties diff --git a/gradle.properties b/gradle.properties index e960a4c..eb37bc1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,9 @@ group = org.xbib.groovy name = groovy-extensions -version = 0.0.2 +version = 4.0.0 org.gradle.warning.mode = ALL -groovy.version = 2.5.12 +groovy.version = 4.0.0-rc-1 gradle.wrapper.version = 7.3 files.version = 3.0.0 ftp.version = 2.6.0 @@ -11,4 +11,4 @@ mail.version = 1.6.2 sshd.version = 2.6.0.0 junit4.version = 4.13.2 jgit.version = 5.13.0.202109080827-r -spock.version = 2.0-groovy-2.5 +spock.version = 2.0-groovy-3.0 diff --git a/gradle/compile/groovy.gradle b/gradle/compile/groovy.gradle index c70f6b9..b7a58d4 100644 --- a/gradle/compile/groovy.gradle +++ b/gradle/compile/groovy.gradle @@ -1,17 +1,17 @@ apply plugin: 'groovy' dependencies { - implementation "org.codehaus.groovy:groovy:${project.property('groovy.version')}" + implementation "org.apache.groovy:groovy:${project.property('groovy.version')}" } compileGroovy { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } compileTestGroovy { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } tasks.withType(GroovyCompile) { diff --git a/gradle/compile/java.gradle b/gradle/compile/java.gradle index c9bba7f..224b9f4 100644 --- a/gradle/compile/java.gradle +++ b/gradle/compile/java.gradle @@ -6,13 +6,13 @@ java { } compileJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } compileTestJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } jar { diff --git a/gradle/ide/idea.gradle b/gradle/ide/idea.gradle index 64e2167..5bd2095 100644 --- a/gradle/ide/idea.gradle +++ b/gradle/ide/idea.gradle @@ -6,8 +6,3 @@ idea { testOutputDir file('build/classes/java/test') } } - -if (project.convention.findPlugin(JavaPluginConvention)) { - //sourceSets.main.output.classesDirs = file("build/classes/java/main") - //sourceSets.test.output.classesDirs = file("build/classes/java/test") -} diff --git a/groovy-crypt/gradle.properties b/groovy-crypt/gradle.properties deleted file mode 100644 index d9455e2..0000000 --- a/groovy-crypt/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version = 2.2.0 \ No newline at end of file diff --git a/groovy-ftp/gradle.properties b/groovy-ftp/gradle.properties deleted file mode 100644 index cb81dd4..0000000 --- a/groovy-ftp/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version = 2.6.0 \ No newline at end of file diff --git a/groovy-ftps/gradle.properties b/groovy-ftps/gradle.properties deleted file mode 100644 index cb81dd4..0000000 --- a/groovy-ftps/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version = 2.6.0 \ No newline at end of file diff --git a/groovy-git/build.gradle b/groovy-git/build.gradle index ec1ff68..f760d32 100644 --- a/groovy-git/build.gradle +++ b/groovy-git/build.gradle @@ -2,7 +2,7 @@ apply from: rootProject.file('gradle/compile/groovy.gradle') dependencies { api "org.eclipse.jgit:org.eclipse.jgit:${project.property('jgit.version')}" - testImplementation "org.codehaus.groovy:groovy:${project.property('groovy.version')}" + testImplementation "org.apache.groovy:groovy:${project.property('groovy.version')}" testImplementation "org.spockframework:spock-core:${project.property('spock.version')}" testImplementation "org.spockframework:spock-junit4:${project.property('spock.version')}" } diff --git a/groovy-git/gradle.properties b/groovy-git/gradle.properties deleted file mode 100644 index eeb1390..0000000 --- a/groovy-git/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version = 2.1.0 diff --git a/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/AnnotateAtRuntimeASTTransformation.java b/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/AnnotateAtRuntimeASTTransformation.java index 7976bc4..ad89fa4 100644 --- a/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/AnnotateAtRuntimeASTTransformation.java +++ b/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/AnnotateAtRuntimeASTTransformation.java @@ -18,7 +18,7 @@ public final class AnnotateAtRuntimeASTTransformation extends AbstractASTTransfo AnnotatedNode parent = (AnnotatedNode) nodes[1]; ClassNode clazz = (ClassNode) parent; - List annotations = getMemberList(annotation, "annotations"); + List annotations = getMemberStringList(annotation, "annotations"); for (String name : annotations) { // !!! UGLY HACK !!! // Groovy won't think the class is an annotation when creating a ClassNode just based on the name. diff --git a/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/WithOperationsASTTransformation.java b/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/WithOperationsASTTransformation.java index b91d492..df5fc05 100644 --- a/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/WithOperationsASTTransformation.java +++ b/groovy-git/src/main/groovy/org/xbib/groovy/git/internal/WithOperationsASTTransformation.java @@ -42,11 +42,15 @@ public class WithOperationsASTTransformation extends AbstractASTTransformation { if (parent instanceof ClassNode) { ClassNode clazz = (ClassNode) parent; - List staticOps = getClassList(annotation, "staticOperations"); - List instanceOps = getClassList(annotation, "instanceOperations"); + List staticOps = getMemberClassList(annotation, "staticOperations"); + List instanceOps = getMemberClassList(annotation, "instanceOperations"); - staticOps.forEach(op -> makeMethods(clazz, op, true)); - instanceOps.forEach(op -> makeMethods(clazz, op, false)); + if (staticOps != null) { + staticOps.forEach(op -> makeMethods(clazz, op, true)); + } + if (instanceOps != null) { + instanceOps.forEach(op -> makeMethods(clazz, op, false)); + } } } diff --git a/groovy-ldap/gradle.properties b/groovy-ldap/gradle.properties deleted file mode 100644 index d9455e2..0000000 --- a/groovy-ldap/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version = 2.2.0 \ No newline at end of file diff --git a/groovy-mail/gradle.properties b/groovy-mail/gradle.properties deleted file mode 100644 index d9455e2..0000000 --- a/groovy-mail/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version = 2.2.0 \ No newline at end of file diff --git a/groovy-sshd/gradle.properties b/groovy-sshd/gradle.properties deleted file mode 100644 index f500770..0000000 --- a/groovy-sshd/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -version = 3.0.0.0