Skip to content

Commit 1576164

Browse files
committed
#111 Adding support for deploying custom forests
1 parent 1142c0b commit 1576164

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/main/groovy/com/marklogic/gradle/MarkLogicPlugin.groovy

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.marklogic.gradle
22

3+
import com.marklogic.appdeployer.command.forests.DeployCustomForestsCommand
4+
import com.marklogic.gradle.task.forests.DeployCustomForestsTask
35
import org.gradle.api.Plugin
46
import org.gradle.api.Project
57
import org.slf4j.LoggerFactory
@@ -181,7 +183,8 @@ class MarkLogicPlugin implements Plugin<Project> {
181183

182184
String forestGroup = "ml-gradle Forest"
183185
project.task("mlConfigureForestReplicas", type: ConfigureForestReplicasTask, group: forestGroup, description: "Deprecated - configure forest replicas via the command.forestNamesAndReplicaCounts map")
184-
project.task("mlDeleteForestReplicas", type: DeleteForestReplicasTask, group: forestGroup, description: "Delete forest replicas via the command.forestNamesAndReplicaCounts map")
186+
project.task("mlDeleteForestReplicas", type: DeleteForestReplicasTask, group: forestGroup, description: "Deprecated - delete forest replicas via the command.forestNamesAndReplicaCounts map")
187+
project.task("mlDeployCustomForests", type: DeployCustomForestsTask, group: forestGroup, description: "Deploy custom forests as defined in subdirectories of the forests configuration directory")
185188
project.task("mlDeployForestReplicas", type: DeployForestReplicasTask, group: forestGroup, description: "Prefer this over mlConfigureForestReplicas; it does the same thing, but uses the ConfigureForestReplicasCommand that is used by mlDeploy")
186189

187190
String groupsGroup = "ml-gradle Group"
@@ -384,6 +387,12 @@ class MarkLogicPlugin implements Plugin<Project> {
384387
project.extensions.add("mlMimetypeCommands", mimetypeCommands)
385388
commands.addAll(mimetypeCommands)
386389

390+
// Forests
391+
List<Command> forestCommands = new ArrayList<Command>()
392+
forestCommands.add(new DeployCustomForestsCommand())
393+
project.extensions.add("mlForestCommands", forestCommands)
394+
commands.addAll(forestCommands)
395+
387396
// Forest replicas
388397
List<Command> replicaCommands = new ArrayList<Command>()
389398
replicaCommands.add(new ConfigureForestReplicasCommand())
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.marklogic.gradle.task.forests
2+
3+
import com.marklogic.gradle.task.MarkLogicTask
4+
import org.gradle.api.tasks.TaskAction
5+
6+
class DeployCustomForestsTask extends MarkLogicTask {
7+
8+
@TaskAction
9+
void deployCustomForests() {
10+
invokeDeployerCommandWithClassName("DeployCustomForestsCommand")
11+
}
12+
}

0 commit comments

Comments
 (0)