Towards the unified {java command

This commit is contained in:
Bruce Eckel 2016-07-27 17:31:28 -06:00
parent e84910951c
commit 72a37051d3

View File

@ -25,9 +25,12 @@ class Tags {
mainMethod = block.contains('main(String[] args)')
fileRoot = lines[0].split("/")[-1] - ".java"
mainClass = fileRoot
javaCmd = extract('main:')
if(javaCmd)
javaCmd = extract('java')
if(javaCmd) {
mainClass = javaCmd
println("fileRoot: " + fileRoot)
println("mainClass: " + mainClass)
}
compileTimeError = testFor('CompileTimeError')
throwsException = testFor('ThrowsException')
errorOutputExpected = testFor('ErrorOutputExpected')
@ -58,6 +61,7 @@ class Tags {
if(tagline.getCount()) {
def rtrim = tagline[0].reverse().dropWhile{ it != '}'}.reverse()[0..-2]
def ltrim = rtrim - ("// {" + marker)
ltrim = ltrim.replaceAll("//", " ")
return ltrim.trim()
} else {
println "Searching for: " + re