Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 27f9db2

Browse files
author
Bruce Eckel
committed
Refactored tagging system
1 parent e16b834 commit 27f9db2

19 files changed

+26
-24
lines changed

buildSrc/src/main/groovy/com/mindviewinc/plugins/TaggingPlugin.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class TaggingPlugin implements Plugin<Project> {
5858
File errFile = new File(file.parentFile, baseName + '.err')
5959

6060
javaTask.configure {
61-
ignoreExitValue = tags.validateByHand || tags.throwsException
61+
ignoreExitValue = tags.excludeFromGradle || tags.throwsException
6262
doFirst {
6363
if(outFile.exists())
6464
outFile.delete()
@@ -77,7 +77,7 @@ class TaggingPlugin implements Plugin<Project> {
7777
}
7878
}
7979

80-
if (!tags.validateByHand) {
80+
if (!tags.excludeFromGradle) {
8181
// Only add tasks that we know we can run successfully to the task list
8282
createdTasks.add(javaTask)
8383
}

buildSrc/src/main/groovy/com/mindviewinc/plugins/Tags.groovy

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Tags {
99
Boolean lowLevelAppendix = false
1010
Boolean throwsException = false
1111
Boolean errorOutputExpected = false
12-
Boolean validateByHand = false
12+
Boolean excludeFromGradle = false
1313
Boolean ignoreOutput = false // This tag isn't used in the build...
1414
String fileRoot
1515
String mainClass
@@ -44,7 +44,7 @@ class Tags {
4444
lowLevelAppendix = firstLine.contains("// lowlevel/")
4545
throwsException = hasTag('ThrowsException')
4646
errorOutputExpected = hasTag('ErrorOutputExpected')
47-
validateByHand = hasTag('ValidateByHand')
47+
excludeFromGradle = hasTag('ExcludeFromGradle')
4848
ignoreOutput = hasTag('IgnoreOutput')
4949
javap = extract('javap') // Includes only arguments to command
5050
runFirst = extract('RunFirst:')
@@ -82,7 +82,7 @@ class Tags {
8282
excludeFromCI ||
8383
throwsException ||
8484
errorOutputExpected ||
85-
validateByHand ||
85+
excludeFromGradle ||
8686
ignoreOutput ||
8787
javaCmd ||
8888
args ||
@@ -104,7 +104,7 @@ class Tags {
104104
excludeFromCI
105105
throwsException
106106
errorOutputExpected
107-
validateByHand
107+
excludeFromGradle
108108
ignoreOutput
109109
fileRoot
110110
mainClass

collections/EnvironmentVariables.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.util.*;
77

88
public class EnvironmentVariables {

compression/GZIPcompress.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
55
// {java GZIPcompress GZIPcompress.java}
6-
// {ValidateByHand}
6+
// {VisuallyInspectOutput}
77
import java.util.zip.*;
88
import java.io.*;
99

compression/ZipCompress.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Uses Zip compression to compress any
66
// number of files given on the command line
77
// {java ZipCompress ZipCompress.java}
8-
// {ValidateByHand}
8+
// {VisuallyInspectOutput}
99
import java.util.zip.*;
1010
import java.io.*;
1111
import java.util.*;

concurrent/CountingStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.util.*;
77
import java.util.concurrent.*;
88
import java.util.stream.*;

concurrent/DiningPhilosophers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
55
// Hidden deadlock
6-
// {ValidateByHand} Gradle has trouble
6+
// {ExcludeFromGradle} Gradle has trouble
77
import java.util.*;
88
import java.util.concurrent.*;
99
import onjava.Nap;

concurrent/ParallelStreamPuzzle3.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.util.*;
77
import java.util.stream.*;
88

files/PathWatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.io.IOException;
77
import java.nio.file.*;
88
import static java.nio.file.StandardWatchEventKinds.*;

files/TreeWatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.io.IOException;
77
import java.nio.file.*;
88
import static java.nio.file.StandardWatchEventKinds.*;

iostreams/BasicFileOutput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.io.*;
77

88
public class BasicFileOutput {

iostreams/BufferedInputFile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.io.*;
77
import java.util.stream.*;
88

iostreams/FileOutputShortcut.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.io.*;
77

88
public class FileOutputShortcut {

iostreams/FormattedMemoryInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.io.*;
77

88
public class FormattedMemoryInput {

iostreams/MemoryInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand}
5+
// {VisuallyInspectOutput}
66
import java.io.*;
77

88
public class MemoryInput {

iostreams/TestEOF.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
55
// Testing for end of file
6-
// {ValidateByHand}
6+
// {VisuallyInspectOutput}
77
import java.io.*;
88

99
public class TestEOF {

lowlevel/EvenProducer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
55
// When threads collide
6-
// {ValidateByHand}
6+
// {VisuallyInspectOutput}
77

88
public class EvenProducer extends IntGenerator {
99
private int currentEvenValue = 0;

lowlevel/ThreadSize.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// (c)2017 MindView LLC: see Copyright.txt
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
5-
// {ValidateByHand} Takes a long time or hangs
5+
// {ExcludeFromGradle} Takes a long time or hangs
66
import java.util.concurrent.*;
77
import onjava.Nap;
88

strings/InfiniteRecursion.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
// We make no guarantees that this code is fit for any purpose.
44
// Visit http://OnJava8.com for more book information.
55
// Accidental recursion
6-
// {ValidateByHand} Throws very long exception
6+
// {ThrowsException}
7+
// {VisuallyInspectOutput} Throws very long exception
78
import java.util.*;
89
import java.util.stream.*;
910

1011
public class InfiniteRecursion {
1112
@Override
1213
public String toString() {
13-
return " InfiniteRecursion address: " + this + "\n";
14+
return
15+
" InfiniteRecursion address: " + this + "\n";
1416
}
1517
public static void main(String[] args) {
1618
Stream.generate(InfiniteRecursion::new)

0 commit comments

Comments
 (0)