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 2020/04/15 07:20:26 UTC

[groovy] 01/02: add project for tests which need --enable-preview set

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 da8e81f68ab9a32362e84b1e9cae56410d29b4eb
Author: Paul King <pa...@asert.com.au>
AuthorDate: Wed Apr 15 17:19:38 2020 +1000

    add project for tests which need --enable-preview set
---
 build.gradle                                  |  2 +-
 settings.gradle                               |  1 +
 subprojects/binary-compatibility/build.gradle |  2 +-
 subprojects/tests-preview/build.gradle        | 36 +++++++++++++++++++++++++++
 4 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/build.gradle b/build.gradle
index 1496ea1..bf7c67c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -59,7 +59,7 @@ buildScanRecipes {
 }
 
 ext.modules = {
-    subprojects.findAll{ !['performance', 'binary-compatibility'].contains(it.name) }
+    subprojects.findAll{ !['performance', 'binary-compatibility', 'tests-preview'].contains(it.name) }
 }
 ext.isReleaseVersion = !groovyVersion.toLowerCase().endsWith("snapshot")
 
diff --git a/settings.gradle b/settings.gradle
index 11455fe..f11e894 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -56,6 +56,7 @@ def subprojects = ['groovy-ant',
         'groovy-xml',
         'groovy-yaml',
         'performance',
+        'tests-preview',
         'binary-compatibility'
 ]
 
diff --git a/subprojects/binary-compatibility/build.gradle b/subprojects/binary-compatibility/build.gradle
index 4fa05ef..ead7e47 100644
--- a/subprojects/binary-compatibility/build.gradle
+++ b/subprojects/binary-compatibility/build.gradle
@@ -45,7 +45,7 @@ tasks.check {
 
 // for comparing between versions with different modules, set excludeModules to differing modules, e.g.
 Set excludeModules = [
-        "performance", "binary-compatibility"
+        "performance", "binary-compatibility", "tests-preview"
 ]
 
 def compatibilityBaselineVersion = "3.0.2"
diff --git a/subprojects/tests-preview/build.gradle b/subprojects/tests-preview/build.gradle
new file mode 100644
index 0000000..22e10f2
--- /dev/null
+++ b/subprojects/tests-preview/build.gradle
@@ -0,0 +1,36 @@
+/*
+ *  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.
+ */
+dependencies {
+    compile rootProject
+    testCompile project(':groovy-test')
+}
+
+tasks.withType(Test) {
+    jvmArgs += "--enable-preview"
+}
+
+sourceSets {
+    test {
+        groovy {
+            if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_14)) {
+                exclude '**/vm14/*'
+            }
+        }
+    }
+}