11package com.marklogic.gradle.task.client
22
3+ import com.marklogic.appdeployer.command.modules.DeleteTestModulesCommand
34import org.gradle.api.tasks.TaskAction
45
56import com.marklogic.appdeployer.AppDeployer
@@ -9,18 +10,27 @@ import com.marklogic.gradle.task.MarkLogicTask
910
1011class 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