public abstract class ProjectBuildFile
extends groovy.lang.Script
Modifier and Type | Field and Description |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
ENV |
GlobalConfiguration |
global |
org.savantbuild.output.Output |
output |
Project |
project |
RuntimeConfiguration |
runtimeConfiguration |
Switches |
switches |
java.util.Properties |
SYS |
Constructor and Description |
---|
ProjectBuildFile() |
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 . |
java.lang.Object |
getProperty(java.lang.String property) |
protected Plugin |
loadPlugin(java.util.Map<java.lang.String,java.lang.Object> attributes)
Loads a plugin and returns a new instance of the Plugin class.
|
protected Project |
project(java.util.Map<java.lang.String,java.lang.Object> attributes,
groovy.lang.Closure closure)
Sets up the project information in the build file.
|
protected Target |
target(java.util.Map<java.lang.String,java.lang.Object> attributes,
groovy.lang.Closure closure)
Adds a target to the project.
|
public final java.util.Map<java.lang.String,java.lang.String> ENV
public final java.util.Properties SYS
public final GlobalConfiguration global
public org.savantbuild.output.Output output
public Project project
public RuntimeConfiguration runtimeConfiguration
public Switches switches
public java.lang.Object getProperty(java.lang.String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class groovy.lang.Script
protected void fail(java.lang.String message, java.lang.Object... values)
BuildFailureException
.message
- The failure message.values
- Values used to format the message.protected Plugin loadPlugin(java.util.Map<java.lang.String,java.lang.Object> attributes)
Loads a plugin and returns a new instance of the Plugin class. This method is called with the information used to load the plugin like this:
java = loadPlugin(id: "org.savantbuild.plugin:java:0.1.0")
attributes
- The Attributes used to load the plugin.protected Project project(java.util.Map<java.lang.String,java.lang.Object> attributes, @DelegatesTo(value=ProjectDelegate.class) groovy.lang.Closure closure)
Sets up the project information in the build file. This method is called with a Map of values and a closure like this:
project(group: "org.example", name: "my-project", version: "1.1", licenses: ["Commercial"]) { }
The require attributes are:
group: The name of the group that the project belongs to name: The name of the project version: The semantic version of the project. licenses: The license(s) of the project.
attributes
- The attributes.closure
- The closure that is invoked for the project configuration handling.protected Target target(java.util.Map<java.lang.String,java.lang.Object> attributes, groovy.lang.Closure closure)
Adds a target to the project. This method is called with a Map of values and a closure like this:
target(name: "compile", description: "Compiles") { ... }
The required attributes are:
name: The name of the target
attributes
- The attributes of the target.closure
- The closure that contains the executable pieces of the target.