Skip to content

Commit 0a446e1

Browse files
committed
#231 mlLoadModules now deletes test modules
And mlReloadModules as well
1 parent 4cac393 commit 0a446e1

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed
Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.marklogic.gradle.task.client
22

3+
import com.marklogic.appdeployer.command.modules.DeleteTestModulesCommand
34
import org.gradle.api.tasks.TaskAction
45

56
import com.marklogic.appdeployer.AppDeployer
@@ -9,18 +10,27 @@ import com.marklogic.gradle.task.MarkLogicTask
910

1011
class LoadModulesTask extends MarkLogicTask {
1112

12-
@TaskAction
13-
void loadModules() {
14-
LoadModulesCommand command = null
15-
// Check for a LoadModulesCommand 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("LoadModulesCommand")
20-
}
21-
if (command == null) {
22-
command = new LoadModulesCommand()
23-
}
24-
command.execute(getCommandContext())
25-
}
13+
@TaskAction
14+
void loadModules() {
15+
LoadModulesCommand command = null
16+
DeleteTestModulesCommand deleteCommand = null
17+
18+
// Check for a LoadModulesCommand in the AppDeployer first, as that may have additional configuration that we
19+
// don't want to have to duplicate on this task
20+
AppDeployer d = getAppDeployer()
21+
if (d instanceof SimpleAppDeployer) {
22+
command = d.getCommand("LoadModulesCommand")
23+
deleteCommand = d.getCommand("DeleteTestModulesCommand")
24+
}
25+
26+
if (command == null) {
27+
command = new LoadModulesCommand()
28+
}
29+
if (deleteCommand == null) {
30+
deleteCommand = new DeleteTestModulesCommand()
31+
}
32+
33+
command.execute(getCommandContext())
34+
deleteCommand.execute(getCommandContext())
35+
}
2636
}

0 commit comments

Comments
 (0)