-
Notifications
You must be signed in to change notification settings - Fork 0
Local deployment
To make Hextant recognize your plugin, you have to add a file plugin.json
at the root of your resources-folder.
In this Json-file you have to include the basic information about your plugin.
Here is an example of how the plugin.json
-file for the expression editor looks:
{
"id": "expr",
"name": "Expressions",
"author": "Nikolaus Knop",
"type": "Language",
"description": "A simple editor for arithmetic expressions",
"dependencies": [
{
"id": "core"
}
],
"initializer": "ExprPlugin"
}
Perhaps the most important property is the initializer
-field,
as it tells the Hextant framework that whenever the plugin with the id
"expr" is loaded,
the class ExprPlugin
, which must be a subclass of hextant.core.plugin.PluginInitializer
should be applied.
For more information about the plugin info file, look at the Json
schema.
The last step to deploy your plugin locally is to copy the Jar-file made by Gradle to the global plugin directory.
It is located in the hextant
directory directly under your user home directory.
To automate this, you can add the following to your build.gradle
and use the hextantPublish
-task,
everytime you want to re-deploy your plugin.
task('hextantPublish', type: Copy) {
from jar.outputs.files
into "${System.getProperty("user.home")}/hextant/plugins"
rename '(.+)', project.name + ".jar"
}
If you want, you can also add the following line to your build-script, which will re-deploy your plugin everytime you build your project.
afterEvaluate { build.finalizedBy(hextantPublish) }
After having deployed your plugin, you can use the "Launch Hextant" run-configuration to launch Hextant.
To learn about contexts and properties, checkout the next tutorial: Contexts and Properties.