Skip to content

Commit 137e014

Browse files
build: Gradle 9.4 compatibility
Signed-off-by: Andreas Reichel <andreas@manticore-projects.com> Signed-off-by: manticore-projects <andreas@manticore-projects.com>
1 parent c812d43 commit 137e014

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

build.gradle

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -467,27 +467,32 @@ tasks.register('renderRR') {
467467

468468
// Convert JJ file to EBNF
469469
def ebnfFile = new File(rrDir, "JSqlParserCC.ebnf")
470-
project.javaexec {
471-
standardOutput = new FileOutputStream(ebnfFile)
472-
mainClass.set("-jar")
473-
args = [
474-
new File(rrDir, "convert.war").absolutePath,
475-
layout.buildDirectory.dir("generated/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jj").get().asFile.absolutePath
476-
]
470+
def jjFile = layout.buildDirectory.dir("generated/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jj").get().asFile.absolutePath
471+
472+
def convertProc = new ProcessBuilder('java', '-jar',
473+
new File(rrDir, "convert.war").absolutePath,
474+
jjFile)
475+
.redirectOutput(ebnfFile)
476+
.redirectErrorStream(true)
477+
.start()
478+
if (convertProc.waitFor() != 0) {
479+
throw new GradleException("Failed to convert JJ to EBNF")
477480
}
478481

479482
// Generate RR diagrams
480-
project.javaexec {
481-
mainClass.set("-jar")
482-
args = [
483-
new File(rrDir, "rr.war").absolutePath,
484-
"-noepsilon",
485-
"-color:#4D88FF",
486-
"-offset:0",
487-
"-width:800",
488-
"-out:${new File(rrDir, "JSqlParserCC.xhtml")}",
489-
new File(rrDir, "JSqlParserCC.ebnf").absolutePath
490-
]
483+
def rrProc = new ProcessBuilder('java', '-jar',
484+
new File(rrDir, "rr.war").absolutePath,
485+
"-noepsilon",
486+
"-color:#4D88FF",
487+
"-offset:0",
488+
"-width:800",
489+
"-out:${new File(rrDir, "JSqlParserCC.xhtml")}",
490+
new File(rrDir, "JSqlParserCC.ebnf").absolutePath)
491+
.redirectErrorStream(true)
492+
.start()
493+
rrProc.inputStream.eachLine { logger.info(it) }
494+
if (rrProc.waitFor() != 0) {
495+
throw new GradleException("Failed to generate RR diagrams")
491496
}
492497
}
493498
}

0 commit comments

Comments
 (0)