You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2021/06/19 16:57:12 UTC

[groovy] 01/01: Add openjdk17 build to travis ci

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch danielsun/tweak-build
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit b0baab13cb0c06a2f9613db782f3d90eb7fae48a
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sun Jun 20 00:29:54 2021 +0800

    Add openjdk17 build to travis ci
---
 .travis.yml                                                          | 2 ++
 src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | 2 +-
 .../groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy      | 5 ++++-
 .../groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy      | 5 ++++-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index f6a28cd..05a8d44 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -25,6 +25,8 @@ install:
 
 matrix:
   include:
+    - env: BC='indy' FEATURE='17' TARGET_JAVA_HOME="/home/travis/openjdk$FEATURE" LICENSE='GPL'
+      jdk: openjdk11
     - env: BC='indy' FEATURE='16' TARGET_JAVA_HOME="/home/travis/openjdk$FEATURE" LICENSE='GPL'
       jdk: openjdk11
     - env: BC='indy'
diff --git a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
index d706387..40a7432 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -134,7 +134,7 @@ public class CompilerConfiguration {
     /**
      * The ASM API version used when loading/parsing classes and generating proxy adapter classes.
      */
-    public static final int ASM_API_VERSION = Opcodes.ASM8;
+    public static final int ASM_API_VERSION = Opcodes.ASM9;
 
     /**
      * The default source encoding.
diff --git a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy
index 981c0a0..3cdd15e 100644
--- a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy
+++ b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8496Test.groovy
@@ -18,6 +18,8 @@
  */
 package groovy.ant
 
+import static groovy.test.GroovyAssert.isAtLeastJdk
+
 class Groovy8496Test extends AntTestCase {
     void testGetProperty() {
 //        def debugLogger = new org.apache.tools.ant.DefaultLogger()
@@ -51,7 +53,8 @@ class Groovy8496Test extends AntTestCase {
             ant.groovyc(srcdir: 'src', destdir: 'build')
             ant.javac(classpath: cp, destdir: 'build', srcdir: 'src', includeantruntime: 'false', fork: 'true')
             ant.java(classpath: cp, outputproperty: 'result', classname: 'OverrideGetProperty')
-            assert ant.project.properties.result == 'bar!'
+            // JDK17: 'WARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.\nbar!\nWARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.'
+            assert isAtLeastJdk('17.0') ? ant.project.properties.result.contains('bar!') : ant.project.properties.result == 'bar!'
         }
     }
 }
diff --git a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy
index 1991c2d..886ebd4 100644
--- a/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy
+++ b/subprojects/groovy-ant/src/test/groovy/groovy/ant/Groovy8497Test.groovy
@@ -18,6 +18,8 @@
  */
 package groovy.ant
 
+import static groovy.test.GroovyAssert.isAtLeastJdk
+
 class Groovy8497Test extends AntTestCase {
     void testGetProperty() {
 //        def debugLogger = new org.apache.tools.ant.DefaultLogger()
@@ -47,7 +49,8 @@ class Groovy8497Test extends AntTestCase {
             ant.groovyc(srcdir: 'src', destdir: 'build')
             ant.javac(classpath: cp, destdir: 'build', srcdir: 'src', includeantruntime: 'false', fork: 'true')
             ant.java(classpath: cp, outputproperty: 'result', classname: 'AccessGetProperty')
-            assert ant.project.properties.result == 'FOO!'
+            // JDK17: 'WARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.\nFOO!\nWARNING: java.lang.System::setSecurityManager is deprecated and will be removed in a future release.'
+            assert isAtLeastJdk('17.0') ? ant.project.properties.result.contains('FOO!') : ant.project.properties.result == 'FOO!'
         }
     }
 }