Skip to content

Commit 32bb36f

Browse files
committed
Fix logging failure when using MLCP and no build directory exists.
asdf
1 parent ac835e6 commit 32bb36f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/groovy/com/marklogic/gradle/task/MlcpTask.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ class MlcpTask extends JavaExec {
208208
File logOutputFile = null
209209
if (logOutputUri) {
210210
println "Will write mlcp log output to URI: " + logOutputUri
211-
logOutputFile = new File(getProject().getBuildDir(), "mlcp-log-output-" + System.currentTimeMillis() + ".txt")
211+
def buildDir = getProject().layout.buildDirectory.asFile.get()
212+
if (!buildDir.exists()) {
213+
buildDir.mkdir()
214+
}
215+
logOutputFile = new File(buildDir, "mlcp-log-output-" + System.currentTimeMillis() + ".txt")
212216
setStandardOutput(logOutputFile.newOutputStream())
213217
}
214218

0 commit comments

Comments
 (0)