From 9706bfaa651d739a07a937a404486cf21054dded Mon Sep 17 00:00:00 2001 From: Bruce Eckel Date: Fri, 3 Sep 2021 17:55:34 -0600 Subject: [PATCH] Added support for // {NewFeature} tag for features newer than Java 8 --- .../main/groovy/com/mindviewinc/plugins/TaggingPlugin.groovy | 1 + buildSrc/src/main/groovy/com/mindviewinc/plugins/Tags.groovy | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/buildSrc/src/main/groovy/com/mindviewinc/plugins/TaggingPlugin.groovy b/buildSrc/src/main/groovy/com/mindviewinc/plugins/TaggingPlugin.groovy index a72dadde..518a7d5f 100644 --- a/buildSrc/src/main/groovy/com/mindviewinc/plugins/TaggingPlugin.groovy +++ b/buildSrc/src/main/groovy/com/mindviewinc/plugins/TaggingPlugin.groovy @@ -26,6 +26,7 @@ class TaggingPlugin implements Plugin { // Exclude java sources that will not compile if (tags.willNotCompile + || tags.newFeature // Uses a feature introduced after Java 8 || (tags.lowLevelAppendix && runningInAppveyor) // Exclude entire lowlevel appendix || (tags.excludeFromAppveyorCI && runningInAppveyor) || (tags.excludeFromTravisCI && runningInTravis) diff --git a/buildSrc/src/main/groovy/com/mindviewinc/plugins/Tags.groovy b/buildSrc/src/main/groovy/com/mindviewinc/plugins/Tags.groovy index 9f343be9..f61ed4d7 100644 --- a/buildSrc/src/main/groovy/com/mindviewinc/plugins/Tags.groovy +++ b/buildSrc/src/main/groovy/com/mindviewinc/plugins/Tags.groovy @@ -10,6 +10,7 @@ class Tags { Boolean throwsException = false Boolean errorOutputExpected = false Boolean excludeFromGradle = false + Boolean newFeature = false // For language feature introduced after Java 8 Boolean ignoreOutput = false // This tag isn't used in the build... String fileRoot String mainClass @@ -45,6 +46,7 @@ class Tags { throwsException = hasTag('ThrowsException') errorOutputExpected = hasTag('ErrorOutputExpected') excludeFromGradle = hasTag('ExcludeFromGradle') + newFeature = hasTag('NewFeature') ignoreOutput = hasTag('IgnoreOutput') javap = extract('javap') // Includes only arguments to command runFirst = extract('RunFirst:') @@ -83,6 +85,7 @@ class Tags { throwsException || errorOutputExpected || excludeFromGradle || + newFeature || ignoreOutput || javaCmd || args || @@ -105,6 +108,7 @@ class Tags { throwsException errorOutputExpected excludeFromGradle + newFeature ignoreOutput fileRoot mainClass