File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
src/main/groovy/com/marklogic/gradle/task Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ class MlcpTask extends JavaExec {
2828 // Set this to define a URI in your content database for mlcp output to be written to as a text document
2929 String logOutputUri
3030
31+ // Allow the user to provide a custom DatabaseClient for logging mlcp output
32+ DatabaseClient logClient
33+
3134 Logger getLogger () {
3235 return Logging . getLogger(MlcpTask . class)
3336 }
@@ -109,9 +112,13 @@ class MlcpTask extends JavaExec {
109112 super . exec()
110113
111114 if (logOutputFile != null ) {
112- AppConfig appConfig = project. property(" mlAppConfig" )
113- DatabaseClient client = appConfig. newDatabaseClient()
114- client. newDocumentManager(). write(logOutputUri, new FileHandle (logOutputFile))
115+ DatabaseClient databaseClient
116+ if (logClient != null ) {
117+ databaseClient = logClient
118+ } else {
119+ databaseClient = project. property(" mlAppConfig" ). newDatabaseClient()
120+ }
121+ databaseClient. newDocumentManager(). write(logOutputUri, new FileHandle (logOutputFile))
115122 println " Wrote mlcp log output to URI: " + logOutputUri
116123 }
117124 }
You can’t perform that action at this time.
0 commit comments