Refactored tagging system
This commit is contained in:
parent
e16b83434c
commit
27f9db2cb6
@ -58,7 +58,7 @@ class TaggingPlugin implements Plugin<Project> {
|
|||||||
File errFile = new File(file.parentFile, baseName + '.err')
|
File errFile = new File(file.parentFile, baseName + '.err')
|
||||||
|
|
||||||
javaTask.configure {
|
javaTask.configure {
|
||||||
ignoreExitValue = tags.validateByHand || tags.throwsException
|
ignoreExitValue = tags.excludeFromGradle || tags.throwsException
|
||||||
doFirst {
|
doFirst {
|
||||||
if(outFile.exists())
|
if(outFile.exists())
|
||||||
outFile.delete()
|
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
|
// Only add tasks that we know we can run successfully to the task list
|
||||||
createdTasks.add(javaTask)
|
createdTasks.add(javaTask)
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ class Tags {
|
|||||||
Boolean lowLevelAppendix = false
|
Boolean lowLevelAppendix = false
|
||||||
Boolean throwsException = false
|
Boolean throwsException = false
|
||||||
Boolean errorOutputExpected = false
|
Boolean errorOutputExpected = false
|
||||||
Boolean validateByHand = false
|
Boolean excludeFromGradle = false
|
||||||
Boolean ignoreOutput = false // This tag isn't used in the build...
|
Boolean ignoreOutput = false // This tag isn't used in the build...
|
||||||
String fileRoot
|
String fileRoot
|
||||||
String mainClass
|
String mainClass
|
||||||
@ -44,7 +44,7 @@ class Tags {
|
|||||||
lowLevelAppendix = firstLine.contains("// lowlevel/")
|
lowLevelAppendix = firstLine.contains("// lowlevel/")
|
||||||
throwsException = hasTag('ThrowsException')
|
throwsException = hasTag('ThrowsException')
|
||||||
errorOutputExpected = hasTag('ErrorOutputExpected')
|
errorOutputExpected = hasTag('ErrorOutputExpected')
|
||||||
validateByHand = hasTag('ValidateByHand')
|
excludeFromGradle = hasTag('ExcludeFromGradle')
|
||||||
ignoreOutput = hasTag('IgnoreOutput')
|
ignoreOutput = hasTag('IgnoreOutput')
|
||||||
javap = extract('javap') // Includes only arguments to command
|
javap = extract('javap') // Includes only arguments to command
|
||||||
runFirst = extract('RunFirst:')
|
runFirst = extract('RunFirst:')
|
||||||
@ -82,7 +82,7 @@ class Tags {
|
|||||||
excludeFromCI ||
|
excludeFromCI ||
|
||||||
throwsException ||
|
throwsException ||
|
||||||
errorOutputExpected ||
|
errorOutputExpected ||
|
||||||
validateByHand ||
|
excludeFromGradle ||
|
||||||
ignoreOutput ||
|
ignoreOutput ||
|
||||||
javaCmd ||
|
javaCmd ||
|
||||||
args ||
|
args ||
|
||||||
@ -104,7 +104,7 @@ class Tags {
|
|||||||
excludeFromCI
|
excludeFromCI
|
||||||
throwsException
|
throwsException
|
||||||
errorOutputExpected
|
errorOutputExpected
|
||||||
validateByHand
|
excludeFromGradle
|
||||||
ignoreOutput
|
ignoreOutput
|
||||||
fileRoot
|
fileRoot
|
||||||
mainClass
|
mainClass
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class EnvironmentVariables {
|
public class EnvironmentVariables {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {java GZIPcompress GZIPcompress.java}
|
// {java GZIPcompress GZIPcompress.java}
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.util.zip.*;
|
import java.util.zip.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// Uses Zip compression to compress any
|
// Uses Zip compression to compress any
|
||||||
// number of files given on the command line
|
// number of files given on the command line
|
||||||
// {java ZipCompress ZipCompress.java}
|
// {java ZipCompress ZipCompress.java}
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.util.zip.*;
|
import java.util.zip.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import java.util.stream.*;
|
import java.util.stream.*;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// Hidden deadlock
|
// Hidden deadlock
|
||||||
// {ValidateByHand} Gradle has trouble
|
// {ExcludeFromGradle} Gradle has trouble
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.*;
|
import java.util.concurrent.*;
|
||||||
import onjava.Nap;
|
import onjava.Nap;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.*;
|
import java.util.stream.*;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import static java.nio.file.StandardWatchEventKinds.*;
|
import static java.nio.file.StandardWatchEventKinds.*;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import static java.nio.file.StandardWatchEventKinds.*;
|
import static java.nio.file.StandardWatchEventKinds.*;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
public class BasicFileOutput {
|
public class BasicFileOutput {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.stream.*;
|
import java.util.stream.*;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
public class FileOutputShortcut {
|
public class FileOutputShortcut {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
public class FormattedMemoryInput {
|
public class FormattedMemoryInput {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
public class MemoryInput {
|
public class MemoryInput {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// Testing for end of file
|
// Testing for end of file
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
public class TestEOF {
|
public class TestEOF {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// When threads collide
|
// When threads collide
|
||||||
// {ValidateByHand}
|
// {VisuallyInspectOutput}
|
||||||
|
|
||||||
public class EvenProducer extends IntGenerator {
|
public class EvenProducer extends IntGenerator {
|
||||||
private int currentEvenValue = 0;
|
private int currentEvenValue = 0;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// (c)2017 MindView LLC: see Copyright.txt
|
// (c)2017 MindView LLC: see Copyright.txt
|
||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// 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 java.util.concurrent.*;
|
||||||
import onjava.Nap;
|
import onjava.Nap;
|
||||||
|
|
||||||
|
@ -3,14 +3,16 @@
|
|||||||
// We make no guarantees that this code is fit for any purpose.
|
// We make no guarantees that this code is fit for any purpose.
|
||||||
// Visit http://OnJava8.com for more book information.
|
// Visit http://OnJava8.com for more book information.
|
||||||
// Accidental recursion
|
// Accidental recursion
|
||||||
// {ValidateByHand} Throws very long exception
|
// {ThrowsException}
|
||||||
|
// {VisuallyInspectOutput} Throws very long exception
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.*;
|
import java.util.stream.*;
|
||||||
|
|
||||||
public class InfiniteRecursion {
|
public class InfiniteRecursion {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return " InfiniteRecursion address: " + this + "\n";
|
return
|
||||||
|
" InfiniteRecursion address: " + this + "\n";
|
||||||
}
|
}
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Stream.generate(InfiniteRecursion::new)
|
Stream.generate(InfiniteRecursion::new)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user