Skip to content

Commit

Permalink
marklogic#111 Adding support for deploying custom forests
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrudin committed Jul 22, 2016
1 parent 1142c0b commit 1576164
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/groovy/com/marklogic/gradle/MarkLogicPlugin.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.marklogic.gradle

import com.marklogic.appdeployer.command.forests.DeployCustomForestsCommand
import com.marklogic.gradle.task.forests.DeployCustomForestsTask
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.slf4j.LoggerFactory
Expand Down Expand Up @@ -181,7 +183,8 @@ class MarkLogicPlugin implements Plugin<Project> {

String forestGroup = "ml-gradle Forest"
project.task("mlConfigureForestReplicas", type: ConfigureForestReplicasTask, group: forestGroup, description: "Deprecated - configure forest replicas via the command.forestNamesAndReplicaCounts map")
project.task("mlDeleteForestReplicas", type: DeleteForestReplicasTask, group: forestGroup, description: "Delete forest replicas via the command.forestNamesAndReplicaCounts map")
project.task("mlDeleteForestReplicas", type: DeleteForestReplicasTask, group: forestGroup, description: "Deprecated - delete forest replicas via the command.forestNamesAndReplicaCounts map")
project.task("mlDeployCustomForests", type: DeployCustomForestsTask, group: forestGroup, description: "Deploy custom forests as defined in subdirectories of the forests configuration directory")
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")

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

// Forests
List<Command> forestCommands = new ArrayList<Command>()
forestCommands.add(new DeployCustomForestsCommand())
project.extensions.add("mlForestCommands", forestCommands)
commands.addAll(forestCommands)

// Forest replicas
List<Command> replicaCommands = new ArrayList<Command>()
replicaCommands.add(new ConfigureForestReplicasCommand())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.marklogic.gradle.task.forests

import com.marklogic.gradle.task.MarkLogicTask
import org.gradle.api.tasks.TaskAction

class DeployCustomForestsTask extends MarkLogicTask {

@TaskAction
void deployCustomForests() {
invokeDeployerCommandWithClassName("DeployCustomForestsCommand")
}
}

0 comments on commit 1576164

Please sign in to comment.