Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrudin committed Apr 16, 2018
2 parents 89199c6 + 24b5e51 commit ff49df5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion examples/sample-project/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.marklogic:ml-gradle:3.6.0"
classpath "com.marklogic:ml-gradle:3.6.2"
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=com.marklogic
version=3.6.1
mlAppDeployerDependency=com.marklogic:ml-app-deployer:3.6.1
version=3.6.2
mlAppDeployerDependency=com.marklogic:ml-app-deployer:3.6.2
mlcpUtilDependency=com.marklogic:mlcp-util:0.9.0
mlDataMovementDependency=com.marklogic:marklogic-data-movement-components:1.0
2 changes: 2 additions & 0 deletions src/main/groovy/com/marklogic/gradle/MarkLogicPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.marklogic.gradle.task.groups.DeployGroupsTask
import com.marklogic.gradle.task.groups.SetTraceEventsTask
import com.marklogic.gradle.task.hosts.AssignHostsToGroupsTask
import com.marklogic.gradle.task.mimetypes.DeployMimetypesTask
import com.marklogic.gradle.task.mimetypes.UndeployMimetypesTask
import com.marklogic.gradle.task.qconsole.ExportWorkspacesTask
import com.marklogic.gradle.task.qconsole.ImportWorkspacesTask
import com.marklogic.gradle.task.roxy.RoxyMigrateBuildStepsTask
Expand Down Expand Up @@ -193,6 +194,7 @@ class MarkLogicPlugin implements Plugin<Project> {

String mimetypesGroup = "ml-gradle Mimetypes"
project.task("mlDeployMimetypes", type: DeployMimetypesTask, group: mimetypesGroup, description: "Deploy each mimetype, updating it if it exists, in the configuration directory")
project.task("mlUndeployMimetypes", type: UndeployMimetypesTask, group: mimetypesGroup, description: "Undeploy each mimetype defined in the configuration directory")

String modulesGroup = "ml-gradle Modules"
project.task("mlLoadModules", type: LoadModulesTask, group: modulesGroup, dependsOn: "mlPrepareRestApiDependencies", description: "Loads modules from directories defined by mlAppConfig or via a property on this task").mustRunAfter(["mlClearModulesDatabase"])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.marklogic.gradle.task

import com.marklogic.client.ext.modulesloader.impl.PropertiesModuleManager
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction

class DeleteModuleTimestampsFileTask extends DefaultTask {

String filePath = PropertiesModuleManager.DEFAULT_FILE_PATH
class DeleteModuleTimestampsFileTask extends MarkLogicTask {

@TaskAction
void deleteFile() {
String filePath = getAppConfig().getModuleTimestampsPath()
File f = new File(filePath)
if (f.exists()) {
println "Deleting " + f.getAbsolutePath() + "\n"
f.delete()
} else {
println "Module timestamps file " + filePath + " does not exist, so not deleting"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@ package com.marklogic.gradle.task.cluster

import com.marklogic.gradle.task.MarkLogicTask
import com.marklogic.mgmt.ManageClient
import com.marklogic.mgmt.admin.ActionRequiringRestart
import com.marklogic.mgmt.resource.clusters.ClusterManager
import org.gradle.api.tasks.TaskAction

class RestartClusterTask extends MarkLogicTask {

@TaskAction
void restartCluster() {
final ManageClient client = getManageClient();
getAdminManager().invokeActionRequiringRestart(new ActionRequiringRestart() {
public boolean execute() {
client.postForm("/manage/v2", "state", "restart")
return true;
}
});
println "Restarting local cluster"
new ClusterManager(client).restartLocalCluster(getAdminManager())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.marklogic.gradle.task.mimetypes

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

class UndeployMimetypesTask extends MarkLogicTask {

@TaskAction
void undeployMimetypes() {
undeployWithCommandListProperty("mlMimetypeCommands")
}
}

0 comments on commit ff49df5

Please sign in to comment.