Refactored tagging system

This commit is contained in:
Bruce Eckel 2017-05-17 21:38:05 -06:00
parent e16b83434c
commit 27f9db2cb6
19 changed files with 26 additions and 24 deletions

View File

@ -58,7 +58,7 @@ class TaggingPlugin implements Plugin<Project> {
File errFile = new File(file.parentFile, baseName + '.err')
javaTask.configure {
ignoreExitValue = tags.validateByHand || tags.throwsException
ignoreExitValue = tags.excludeFromGradle || tags.throwsException
doFirst {
if(outFile.exists())
outFile.delete()
@ -77,7 +77,7 @@ class TaggingPlugin implements Plugin<Project> {
}
}
if (!tags.validateByHand) {
if (!tags.excludeFromGradle) {
// Only add tasks that we know we can run successfully to the task list
createdTasks.add(javaTask)
}

View File

@ -9,7 +9,7 @@ class Tags {
Boolean lowLevelAppendix = false
Boolean throwsException = false
Boolean errorOutputExpected = false
Boolean validateByHand = false
Boolean excludeFromGradle = false
Boolean ignoreOutput = false // This tag isn't used in the build...
String fileRoot
String mainClass
@ -44,7 +44,7 @@ class Tags {
lowLevelAppendix = firstLine.contains("// lowlevel/")
throwsException = hasTag('ThrowsException')
errorOutputExpected = hasTag('ErrorOutputExpected')
validateByHand = hasTag('ValidateByHand')
excludeFromGradle = hasTag('ExcludeFromGradle')
ignoreOutput = hasTag('IgnoreOutput')
javap = extract('javap') // Includes only arguments to command
runFirst = extract('RunFirst:')
@ -82,7 +82,7 @@ class Tags {
excludeFromCI ||
throwsException ||
errorOutputExpected ||
validateByHand ||
excludeFromGradle ||
ignoreOutput ||
javaCmd ||
args ||
@ -104,7 +104,7 @@ class Tags {
excludeFromCI
throwsException
errorOutputExpected
validateByHand
excludeFromGradle
ignoreOutput
fileRoot
mainClass

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.util.*;
public class EnvironmentVariables {

View File

@ -3,7 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {java GZIPcompress GZIPcompress.java}
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.util.zip.*;
import java.io.*;

View File

@ -5,7 +5,7 @@
// Uses Zip compression to compress any
// number of files given on the command line
// {java ZipCompress ZipCompress.java}
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.util.zip.*;
import java.io.*;
import java.util.*;

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.util.*;
import java.util.concurrent.*;
import java.util.stream.*;

View File

@ -3,7 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// Hidden deadlock
// {ValidateByHand} Gradle has trouble
// {ExcludeFromGradle} Gradle has trouble
import java.util.*;
import java.util.concurrent.*;
import onjava.Nap;

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.util.*;
import java.util.stream.*;

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.IOException;
import java.nio.file.*;
import static java.nio.file.StandardWatchEventKinds.*;

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.IOException;
import java.nio.file.*;
import static java.nio.file.StandardWatchEventKinds.*;

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.*;
public class BasicFileOutput {

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.*;
import java.util.stream.*;

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.*;
public class FileOutputShortcut {

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.*;
public class FormattedMemoryInput {

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.*;
public class MemoryInput {

View File

@ -3,7 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// Testing for end of file
// {ValidateByHand}
// {VisuallyInspectOutput}
import java.io.*;
public class TestEOF {

View File

@ -3,7 +3,7 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// When threads collide
// {ValidateByHand}
// {VisuallyInspectOutput}
public class EvenProducer extends IntGenerator {
private int currentEvenValue = 0;

View File

@ -2,7 +2,7 @@
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// {ValidateByHand} Takes a long time or hangs
// {ExcludeFromGradle} Takes a long time or hangs
import java.util.concurrent.*;
import onjava.Nap;

View File

@ -3,14 +3,16 @@
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// Accidental recursion
// {ValidateByHand} Throws very long exception
// {ThrowsException}
// {VisuallyInspectOutput} Throws very long exception
import java.util.*;
import java.util.stream.*;
public class InfiniteRecursion {
@Override
public String toString() {
return " InfiniteRecursion address: " + this + "\n";
return
" InfiniteRecursion address: " + this + "\n";
}
public static void main(String[] args) {
Stream.generate(InfiniteRecursion::new)