Added support for // {NewFeature} tag for features newer than Java 8

This commit is contained in:
Bruce Eckel 2021-09-03 17:55:34 -06:00
parent 816c30e912
commit 9706bfaa65
2 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class TaggingPlugin implements Plugin<Project> {
// 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)

View File

@ -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