Package org.savantbuild.parser.groovy
Class ProjectBuildFile
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.Script
org.savantbuild.parser.groovy.ProjectBuildFile
- All Implemented Interfaces:
groovy.lang.GroovyObject
public abstract class ProjectBuildFile
extends groovy.lang.Script
Base class from the project build file Groovy script.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal GlobalConfigurationorg.savantbuild.output.Outputfinal Properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidFails the build with the given message by throwing aBuildFailureException.getProperty(String property) protected PluginloadPlugin(Map<String, Object> attributes) Loads a plugin and returns a new instance of the Plugin class.protected ProjectSets up the project information in the build file.protected TargetAdds a target to the project.Methods inherited from class groovy.lang.Script
evaluate, evaluate, getBinding, invokeMethod, print, printf, printf, println, println, run, run, setBinding, setPropertyMethods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, setMetaClass
-
Field Details
-
ENV
-
SYS
-
global
-
output
public org.savantbuild.output.Output output -
project
-
runtimeConfiguration
-
switches
-
-
Constructor Details
-
ProjectBuildFile
public ProjectBuildFile()
-
-
Method Details
-
getProperty
- Specified by:
getPropertyin interfacegroovy.lang.GroovyObject- Overrides:
getPropertyin classgroovy.lang.Script
-
fail
Fails the build with the given message by throwing aBuildFailureException.- Parameters:
message- The failure message.values- Values used to format the message.
-
loadPlugin
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")
- Parameters:
attributes- The Attributes used to load the plugin.- Returns:
- The Plugin instance.
-
project
protected Project project(Map<String, Object> attributes, @DelegatesTo(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.
- Parameters:
attributes- The attributes.closure- The closure that is invoked for the project configuration handling.- Returns:
- The project.
-
target
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
- Parameters:
attributes- The attributes of the target.closure- The closure that contains the executable pieces of the target.- Returns:
- The Target.
-