public abstract class JkPlugin
extends java.lang.Object
JkClass
instance. The relationship is bidirectional :
JkClass
instances can invoke plugin methods and vice-versa.
Therefore plugins can interact with (or load) other plugins from the owning JkClass
instance
(which is a quite common pattern).
Modifier | Constructor and Description |
---|---|
protected |
JkPlugin(JkClass jkClass) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterSetup()
Override this method to perform some actions, once the plugin has been setup by
JkClass.setup() method. |
protected void |
beforeSetup()
Override this method to initialize the plugin.
|
protected java.lang.String |
getBreakingVersionRegistryUrl()
When publishing a plugin, authors can not guess which future version of Jeka will break compatibility.
|
protected JkClass |
getJkClass() |
protected java.lang.String |
getLowestJekaCompatibleVersion()
Returns a the lowest Jeka version which is compatible with this plugin.
|
void |
help() |
java.lang.String |
name() |
java.lang.String |
toString() |
protected JkPlugin(JkClass jkClass)
public void help()
protected void beforeSetup() throws java.lang.Exception
JkClass.setup()
is invoked.java.lang.Exception
protected void afterSetup() throws java.lang.Exception
JkClass.setup()
method.
Typically, some plugins have to configure other ones (For instance, java plugin configures
scaffold plugin to instruct what to use as a template build class). Those kind of
configuration is better done here as the setup made in JkClass
is likely
to impact the result of the configuration.
java.lang.Exception
protected java.lang.String getLowestJekaCompatibleVersion()
null
and
running Jeka version is lower then a warning log will be emitted.protected java.lang.String getBreakingVersionRegistryUrl()
The register is expected to be a simple flat file.
Each row is structured as pluginVersion : jekaVersion
.
The example below means that :
1.2.1.RELEASE : 0.9.1.RELEASE
1.3.0.RELEASE : 0.9.5.M1
public final java.lang.String name()
protected JkClass getJkClass()
public java.lang.String toString()
toString
in class java.lang.Object