public class BaseGroovyPlugin extends groovy.lang.GroovyObjectSupport implements Plugin
Project
and Output
objects to plugins.Modifier and Type | Field and Description |
---|---|
org.savantbuild.output.Output |
output |
Project |
project |
RuntimeConfiguration |
runtimeConfiguration |
Modifier | Constructor and Description |
---|---|
protected |
BaseGroovyPlugin(Project project,
RuntimeConfiguration runtimeConfiguration,
org.savantbuild.output.Output output) |
Modifier and Type | Method and Description |
---|---|
protected void |
fail(java.lang.String message,
java.lang.Object... values)
Fails the build with the given message by throwing a
BuildFailureException . |
protected java.util.Properties |
loadConfiguration(org.savantbuild.dep.domain.ArtifactID id,
java.lang.String errorMessage)
Loads the plugin configuration file.
|
public final org.savantbuild.output.Output output
public final Project project
public final RuntimeConfiguration runtimeConfiguration
protected BaseGroovyPlugin(Project project, RuntimeConfiguration runtimeConfiguration, org.savantbuild.output.Output output)
protected void fail(java.lang.String message, java.lang.Object... values)
BuildFailureException
.message
- The failure message.values
- Values used to format the message String.protected java.util.Properties loadConfiguration(org.savantbuild.dep.domain.ArtifactID id, java.lang.String errorMessage)
Loads the plugin configuration file. If the configuration file doesn't exist, this throws an exception.
The configuration file location is standardized and based on the ArtifactID of the plugin and the user's home directory.
The location pattern is as follows:
<user.home>/plugins/<id.group>.<id.name>.properties
id
- The artifact Id that is used to load the configuration file.errorMessage
- The error message to print out if the configuration file doesn't exist or is invalid.