-
Notifications
You must be signed in to change notification settings - Fork 80
How ml gradle works
rjrudin edited this page Dec 23, 2015
·
3 revisions
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.