Skip to content

Commit 86429d6

Browse files
committed
Output file erased if it exists, append allows outputLine
1 parent c26ff2b commit 86429d6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,12 @@ subprojects {
144144

145145
String basePath = it.absolutePath.replaceAll('\\.java', '')
146146
File outFile = new File(basePath + '.out')
147+
if(outFile.exists())
148+
outFile.delete()
147149
if(tags.outputLine)
148-
outFile.write(tags.outputLine + "\n")
150+
outFile << tags.outputLine + "\n"
149151
File errFile = new File(basePath + '.err')
150-
OutputStream runStandardOutput = new TeeOutputStream(new FileOutputStream(outFile), System.out)
152+
OutputStream runStandardOutput = new TeeOutputStream(new FileOutputStream(outFile, true), System.out)
151153
OutputStream runErrorOutput = new TeeOutputStream(new FileOutputStream(errFile), System.err)
152154

153155
task "$tags.fileRoot"(type: JavaExec, dependsOn: tags.runFirst) {

0 commit comments

Comments
 (0)