File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed
src/main/groovy/com/marklogic/gradle/task Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33distributionPath =wrapper/dists
44zipStoreBase =GRADLE_USER_HOME
55zipStorePath =wrapper/dists
6- distributionUrl =https\://services.gradle.org/distributions/gradle-3.1 -bin.zip
6+ distributionUrl =https\://services.gradle.org/distributions/gradle-4.10.2 -bin.zip
Original file line number Diff line number Diff line change @@ -44,21 +44,29 @@ class MarkLogicTask extends DefaultTask {
4444 project. hasProperty(" mlAdminPassword" ) ? project. property(" mlAdminPassword" ) : project. property(" mlPassword" )
4545 }
4646
47+ DatabaseClient newClient () {
48+ newClient(null )
49+ }
50+
4751 /**
48- * If the "database" property is set, then the DatabaseClient that's returned will use the App-Services port
49- * (defaults to 8000) to connect to the given database. Otherwise, the DatabaseClient will try to connect to the
50- * REST API server defined by mlRestPort.
52+ * If the "database" property is set or is passed as a parameter , then the DatabaseClient that's returned will use
53+ * the App-Services port (defaults to 8000) to connect to the given database. Otherwise, the DatabaseClient will
54+ * try to connect to the REST API server defined by mlRestPort.
5155 * @return
5256 */
53- DatabaseClient newClient () {
54- if (project. hasProperty(" database" )) {
57+ DatabaseClient newClient (String database ) {
58+ if (database != null ){
59+ println " Connecting via the App-Services port to database: " + database
60+ return getAppConfig(). newAppServicesDatabaseClient(database)
61+ }
62+ else if (project. hasProperty(" database" )) {
5563 println " Connecting via the App-Services port to database: " + project. property(" database" )
5664 return getAppConfig(). newAppServicesDatabaseClient(project. property(" database" ))
5765 }
5866 else {
5967 getAppConfig(). newDatabaseClient()
6068 }
61- }
69+ }
6270
6371 void deployWithCommandListProperty (String propertyName ) {
6472 deployWithCommands(getProject(). property(propertyName))
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class DeleteUserSchemasTask extends MarkLogicTask {
3131 String fullQuery = " cts:uris((), (), " + xquery + " ) ! xdmp:document-delete(.)"
3232 println " Deleting user schemas in database '" + database + " ' via : " + fullQuery
3333
34- def client = newClient()
34+ def client = newClient(database )
3535 try {
3636 client. newServerEval(). xquery(fullQuery). eval()
3737 } finally {
You can’t perform that action at this time.
0 commit comments