Skip to content

Commit fd11197

Browse files
committed
Fixing LoadSchemasTask to invoke all commands in the schema commands list
1 parent ad4ebf2 commit fd11197

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed
Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,12 @@
11
package com.marklogic.gradle.task.schemas
22

3-
import org.gradle.api.tasks.TaskAction
4-
5-
import com.marklogic.appdeployer.AppDeployer
6-
import com.marklogic.appdeployer.command.schemas.LoadSchemasCommand
7-
import com.marklogic.appdeployer.impl.SimpleAppDeployer
83
import com.marklogic.gradle.task.MarkLogicTask
4+
import org.gradle.api.tasks.TaskAction
95

106
class LoadSchemasTask extends MarkLogicTask {
117

12-
@TaskAction
13-
void loadSchemas() {
14-
LoadSchemasCommand command = null
15-
// Check for a LoadSchemasCommand in the AppDeployer first, as that may have additional configuration that we
16-
// don't want to have to duplicate on this task
17-
AppDeployer d = getAppDeployer()
18-
if (d instanceof SimpleAppDeployer) {
19-
command = d.getCommand("LoadSchemasCommand")
20-
}
21-
if (command == null) {
22-
command = new LoadSchemasCommand()
23-
}
24-
command.execute(getCommandContext())
25-
}
8+
@TaskAction
9+
void loadSchemas() {
10+
deployWithCommandListProperty("mlSchemaCommands")
11+
}
2612
}

0 commit comments

Comments
 (0)