[1/2] groovy git commit: jdk11 build fixes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[1/2] groovy git commit: jdk11 build fixes

paulk
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_5_X ca7cd5aca -> 9dbbbffb9


jdk11 build fixes


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/4db73898
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/4db73898
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/4db73898

Branch: refs/heads/GROOVY_2_5_X
Commit: 4db73898f6a5a64d914370ad188c8a9315217dc5
Parents: ca7cd5a
Author: Paul King <[hidden email]>
Authored: Sun Jul 8 17:12:54 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Mon Jul 9 13:39:30 2018 +1000

----------------------------------------------------------------------
 build.gradle                                    |  4 ---
 gradle/jdk9.gradle                              | 28 --------------------
 .../ui/text/StructuredSyntaxResources.java      |  2 +-
 subprojects/groovy-jaxb/build.gradle            | 23 ++++++++++++++++
 subprojects/groovy-xml/build.gradle             | 14 +++++++++-
 5 files changed, 37 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/4db73898/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index aa14d52..355094f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -204,9 +204,6 @@ dependencies {
     testCompile "org.apache.logging.log4j:log4j-core:$log4j2Version"
     testCompile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
     testCompile "com.thoughtworks.qdox:qdox:$qdoxVersion"
-    if (JavaVersion.current().isJava9Compatible()) {
-        testRuntime 'javax.xml.bind:jaxb-api:2.3.0'
-    }
 
     tools "org.pantsbuild:jarjar:$jarjarVersion"
     tools "org.jboss.bridger:bridger:$bridgerVersion"
@@ -484,7 +481,6 @@ apply from: 'gradle/upload.gradle'
 apply from: 'gradle/idea.gradle'
 apply from: 'gradle/eclipse.gradle'
 apply from: 'gradle/quality.gradle'
-apply from: 'gradle/jdk9.gradle'
 apply from: 'gradle/parallel-build-fixes.gradle'
 
 // If a local configuration file for tweaking the build is present, apply it

http://git-wip-us.apache.org/repos/asf/groovy/blob/4db73898/gradle/jdk9.gradle
----------------------------------------------------------------------
diff --git a/gradle/jdk9.gradle b/gradle/jdk9.gradle
deleted file mode 100644
index eb8dfd3..0000000
--- a/gradle/jdk9.gradle
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-if (JavaVersion.current().java9Compatible) {
-    allprojects {
-        tasks.withType(GroovyCompile) {
-            groovyOptions.forkOptions.jvmArgs.addAll(['--add-modules', 'java.xml.bind'])
-        }
-        test {
-            jvmArgs '--add-modules', 'java.xml.bind'
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/groovy/blob/4db73898/subprojects/groovy-console/src/main/groovy/groovy/ui/text/StructuredSyntaxResources.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-console/src/main/groovy/groovy/ui/text/StructuredSyntaxResources.java b/subprojects/groovy-console/src/main/groovy/groovy/ui/text/StructuredSyntaxResources.java
index 1fa1792..62beed8 100644
--- a/subprojects/groovy-console/src/main/groovy/groovy/ui/text/StructuredSyntaxResources.java
+++ b/subprojects/groovy-console/src/main/groovy/groovy/ui/text/StructuredSyntaxResources.java
@@ -41,7 +41,7 @@ public final class StructuredSyntaxResources {
             // a security exception
             SecurityManager mgr = System.getSecurityManager();
             if (mgr != null) {
-                mgr.checkSystemClipboardAccess();
+                mgr.checkPermission(new AWTPermission("accessClipboard"));
             }
             systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
         }

http://git-wip-us.apache.org/repos/asf/groovy/blob/4db73898/subprojects/groovy-jaxb/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-jaxb/build.gradle b/subprojects/groovy-jaxb/build.gradle
index 4a27164..659f439 100644
--- a/subprojects/groovy-jaxb/build.gradle
+++ b/subprojects/groovy-jaxb/build.gradle
@@ -16,12 +16,35 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+configurations {
+    jaxb
+    jaxbRuntime
+}
+
 dependencies {
     compile rootProject
     testCompile project(':groovy-test')
+    jaxb 'javax.xml.bind:jaxb-api:2.3.0'
+    jaxbRuntime 'com.sun.xml.bind:jaxb-core:2.3.0.1'
+    jaxbRuntime 'com.sun.xml.bind:jaxb-impl:2.3.0.1'
+    jaxbRuntime 'javax.activation:activation:1.1.1'
 }
 
 task moduleDescriptor(type: org.codehaus.groovy.gradle.WriteExtensionDescriptorTask) {
     extensionClasses = 'org.apache.groovy.jaxb.extensions.JaxbExtensions'
 }
 compileJava.dependsOn moduleDescriptor
+
+if (JavaVersion.current().isJava9Compatible()) {
+    tasks.withType(JavaCompile) {
+        classpath += configurations.jaxb
+    }
+    tasks.withType(GroovyCompile) {
+        groovyClasspath += configurations.jaxb
+        classpath += configurations.jaxb
+    }
+    tasks.withType(Test) {
+        classpath += configurations.jaxb
+        classpath += configurations.jaxbRuntime
+    }
+}

http://git-wip-us.apache.org/repos/asf/groovy/blob/4db73898/subprojects/groovy-xml/build.gradle
----------------------------------------------------------------------
diff --git a/subprojects/groovy-xml/build.gradle b/subprojects/groovy-xml/build.gradle
index cf514dd..ef25b15 100644
--- a/subprojects/groovy-xml/build.gradle
+++ b/subprojects/groovy-xml/build.gradle
@@ -16,14 +16,26 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+configurations {
+    jaxb // just until we delete deprecated jaxb methods (moved to groovy-jaxb)
+}
+
 dependencies {
     compile rootProject
     testCompile rootProject.sourceSets.test.runtimeClasspath
     testCompile "xmlunit:xmlunit:$xmlunitVersion"
     testCompile project(':groovy-test')
+    jaxb 'javax.xml.bind:jaxb-api:2.3.0'
 }
 
 task moduleDescriptor(type: org.codehaus.groovy.gradle.WriteExtensionDescriptorTask) {
     extensionClasses = 'org.codehaus.groovy.runtime.XmlGroovyMethods'
 }
-compileJava.dependsOn moduleDescriptor
\ No newline at end of file
+compileJava.dependsOn moduleDescriptor
+
+if (JavaVersion.current().isJava9Compatible()) {
+    tasks.withType(GroovyCompile) {
+        groovyClasspath += configurations.jaxb
+        classpath += configurations.jaxb
+    }
+}

Reply | Threaded
Open this post in threaded view
|

[2/2] groovy git commit: remove dup in test jvmArgs plus reduce locale issues on jdk9+

paulk
remove dup in test jvmArgs plus reduce locale issues on jdk9+


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/9dbbbffb
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/9dbbbffb
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/9dbbbffb

Branch: refs/heads/GROOVY_2_5_X
Commit: 9dbbbffb9fab3395d614e1b07100d79d2d835a7a
Parents: 4db7389
Author: Paul King <[hidden email]>
Authored: Sun Jul 8 22:24:54 2018 +1000
Committer: Paul King <[hidden email]>
Committed: Mon Jul 9 13:40:39 2018 +1000

----------------------------------------------------------------------
 gradle/test.gradle | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/9dbbbffb/gradle/test.gradle
----------------------------------------------------------------------
diff --git a/gradle/test.gradle b/gradle/test.gradle
index 02628e2..2abca7c 100644
--- a/gradle/test.gradle
+++ b/gradle/test.gradle
@@ -18,10 +18,15 @@
  */
 allprojects {
     tasks.withType(Test) {
-        if (JavaVersion.current().isJava8Compatible()) {
-            jvmArgs '-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}", "-XX:+UseConcMarkSweepGC", "-Duser.language=en"
+        def jdk8 = ['-XX:+UseConcMarkSweepGC']
+        def jdk9 = ['-Djava.locale.providers=COMPAT,SPI']
+        def common = ['-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}", "-Duser.language=en" ]
+        if (JavaVersion.current().isJava9Compatible()) {
+            jvmArgs (*common, *jdk9)
+        } else if (JavaVersion.current().isJava8Compatible()) {
+            jvmArgs (*common, *jdk8)
         } else {
-            jvmArgs '-ea', "-Xms${groovyJUnit_ms}", "-Xmx${groovyJUnit_mx}", "-XX:PermSize=${groovyJUnit_permSize}", "-XX:MaxPermSize=${groovyJUnit_maxPermSize}", "-XX:+UseConcMarkSweepGC", "-Duser.language=en"
+            jvmArgs (*common, "-XX:PermSize=${groovyJUnit_permSize}", "-XX:MaxPermSize=${groovyJUnit_maxPermSize}")
         }
         def headless = System.properties['java.awt.headless']
         if (headless == 'true') {