public class JkCommands
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
JkCommands()
Constructs a
JkCommands . |
Modifier and Type | Method and Description |
---|---|
void |
clean()
Cleans the output directory.
|
java.nio.file.Path |
getBaseDir()
Returns the base directory for this project.
|
JkPathTree |
getBaseTree()
Returns the base directory tree for this project.
|
JkDependencySet |
getDefDependencies()
Dependencies necessary to compile the this command class.
|
JkImportedCommands |
getImportedCommands()
Returns imported runs with plugins applied on.
|
java.nio.file.Path |
getOutputDir()
Returns the output directory where all the final and intermediate artifacts are generated.
|
<T extends JkPlugin> |
getPlugin(java.lang.Class<T> pluginClass)
Shorthand to
getPlugins().get( . |
JkRunPlugins |
getPlugins()
Returns the container of loaded plugins for this instance.
|
JkDependencyResolver |
getRunDependencyResolver()
Returns the dependency resolver used to compile/run scripts of this project.
|
void |
help()
Displays all available methods defined in this run.
|
static <T extends JkCommands> |
of(java.lang.Class<T> commandClass)
Creates a instance of the specified command class (extending JkCommands), including option injection, plugin loading
and plugin activation.
|
protected void |
setup()
This method is invoked right after options has been injected into this instance.
|
protected void |
setupAfterPluginActivations()
This method is called once all plugin has been activated.
|
java.lang.String |
toString() |
protected JkCommands()
JkCommands
. Using constructor alone won't give you an instance populated with runtime options
neither decorated with plugins. of(Class)
to get instances populated with options and decorated with plugins.public static <T extends JkCommands> T of(java.lang.Class<T> commandClass)
protected void setup()
protected void setupAfterPluginActivations()
public final JkPathTree getBaseTree()
JkPathTree.of(baseDir)
.public final java.nio.file.Path getBaseDir()
public java.nio.file.Path getOutputDir()
public JkRunPlugins getPlugins()
public <T extends JkPlugin> T getPlugin(java.lang.Class<T> pluginClass)
getPlugins().get()
.
Returns the plugin instance of the specified class loaded in the holding JkCommands instance. If it does not hold
a plugin of the specified class at call time, the plugin is loaded then returned.public final JkDependencyResolver getRunDependencyResolver()
public final JkDependencySet getDefDependencies()
public final JkImportedCommands getImportedCommands()
public void clean()
public void help()
public java.lang.String toString()
toString
in class java.lang.Object