IV.A About the plugin - kghmanuel/ml-gradle GitHub Wiki
From a high level, here's how ml-gradle works:
- ml-gradle is a Gradle plugin, so when you apply it in your Gradle file - e.g. "apply plugin: 'ml-gradle'" - Gradle looks for a plugin class to execute.
- The ml-gradle plugin class is MarkLogicPlugin, which we'll refer to as "MLP".
- MLP has two main jobs - initialize a set of objects from the ml-app-deployer library, and initialize a set of tasks which you can view by running "gradle tasks". ml-gradle doesn't really do much at all - it's a thin, Gradle-specific layer that exposes all the useful functionality in ml-app-deployer. ml-app-deployer has no dependency on ml-gradle so that it can be used in any environment.
- The most important object initialized by MLP is an instance of SimpleAppDeployer under the Gradle property name "mlAppDeployer". MLP adds a few dozen different commands from ml-app-deployer; these commands are invoked when you run "gradle mlDeploy" and "gradle mlUndeploy".
- MLP also applies all the properties in gradle.properties - see Configuring ml-gradle for more info on this. When you run gradle with the "-i" or "--info" parameter, you'll see all the properties that are applied.
- Once Gradle has finished executing MLP, all the ml-app-deployer objects and tasks are ready for use.
A huge benefit of Gradle is that you can write any Groovy code you want in build.gradle, so you can make ml-gradle do just about anything you want to do - see the FAQ in this project for more info on extending ml-gradle.
Upgrading ml gradle
In general, upgrading ml-gradle is trivial and is upgraded like any other Gradle plugin - just change the version number in your build.gradle file, e.g.:
plugins {
id "com.marklogic.ml-gradle" version "change this!"
}
The only other thing to take into consideration is if any change listed in the release notes will cause issues for your project.
See the Gradle docs for more info on Gradle plugins.