class GroovyPlugin extends org.savantbuild.plugin.groovy.BaseGroovyPlugin
The Groovy plugin. The public methods on this class define the features of the plugin.
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
ERROR_MESSAGE |
|
static java.lang.String |
JAVA_ERROR_MESSAGE |
| Fields inherited from class | Fields |
|---|---|
class org.savantbuild.plugin.groovy.BaseGroovyPlugin |
output, project, runtimeConfiguration |
| Type | Name and description |
|---|---|
org.savantbuild.plugin.dep.DependencyPlugin |
dependencyPlugin |
org.savantbuild.plugin.file.FilePlugin |
filePlugin |
java.nio.file.Path |
groovyDocPath |
java.lang.String |
groovyHome |
java.nio.file.Path |
groovycPath |
java.lang.String |
javaHome |
java.util.Properties |
javaProperties |
GroovyLayout |
layout |
java.util.Properties |
properties |
GroovySettings |
settings |
| Constructor and description |
|---|
GroovyPlugin(org.savantbuild.domain.Project project, org.savantbuild.runtime.RuntimeConfiguration runtimeConfiguration, org.savantbuild.output.Output output) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
clean()Cleans the build directory by completely deleting it. |
|
void |
compile()Compiles the main and test Java files (src/main/groovy and src/test/groovy). |
|
void |
compile(java.nio.file.Path sourceDirectory, java.nio.file.Path buildDirectory, java.util.List<java.util.Map<java.lang.String, java.lang.Object>> dependencies, java.nio.file.Path[] additionalClasspath)Compiles an arbitrary source directory to an arbitrary build directory. |
|
void |
compileMain()Compiles the main Groovy files (src/main/groovy by default). |
|
void |
compileTest()Compiles the test Groovy files (src/test/groovy by default). |
|
void |
copyResources(java.nio.file.Path sourceDirectory, java.nio.file.Path buildDirectory)Copies the resource files from the source directory to the build directory. |
|
void |
document()Creates the project's Groovydoc. |
|
void |
jar()Creates the project's Jar files. |
|
void |
jar(java.nio.file.Path jarFile, java.nio.file.Path[] directories)Creates a single Jar file by adding all of the files in the given directories. |
| Methods inherited from class | Name |
|---|---|
class org.savantbuild.plugin.groovy.BaseGroovyPlugin |
org.savantbuild.plugin.groovy.BaseGroovyPlugin#getMetaClass(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#setMetaClass(groovy.lang.MetaClass), org.savantbuild.plugin.groovy.BaseGroovyPlugin#wait(long, int), org.savantbuild.plugin.groovy.BaseGroovyPlugin#wait(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#wait(long), org.savantbuild.plugin.groovy.BaseGroovyPlugin#equals(java.lang.Object), org.savantbuild.plugin.groovy.BaseGroovyPlugin#toString(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#hashCode(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#getClass(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#notify(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#notifyAll(), org.savantbuild.plugin.groovy.BaseGroovyPlugin#getProperty(java.lang.String), org.savantbuild.plugin.groovy.BaseGroovyPlugin#setProperty(java.lang.String, java.lang.Object), org.savantbuild.plugin.groovy.BaseGroovyPlugin#invokeMethod(java.lang.String, java.lang.Object) |
Cleans the build directory by completely deleting it.
Here is an example of calling this method:
groovy.clean()
Compiles the main and test Java files (src/main/groovy and src/test/groovy).
Here is an example of calling this method:
groovy.compile()
Compiles an arbitrary source directory to an arbitrary build directory.
Here is an example of calling this method:
groovy.compile(Paths.get("src/foo"), Paths.get("build/bar"), [[group: "compile", transitive: false, fetchSource: false]], Paths.get("additionalClasspathDirectory"))
sourceDirectory - The source directory that contains the groovy source files.buildDirectory - The build directory to compile the groovy files to.dependencies - The dependencies of the project to include in the compile classpath.Compiles the main Groovy files (src/main/groovy by default).
Here is an example of calling this method:
groovy.compileMain()
Compiles the test Groovy files (src/test/groovy by default).
Here is an example of calling this method:
groovy.compileTest()
Copies the resource files from the source directory to the build directory. This copies all of the files recursively to the build directory.
Here is an example of calling this method:
groovy.copyResources(Paths.get("src/some-resources"), Paths.get("build/output-dir"))
sourceDirectory - The source directory that contains the files to copy.buildDirectory - The build directory to copy the files to. Creates the project's Groovydoc. This executes the groovydoc command and outputs the docs to the layout.docDirectory
Here is an example of calling this method:
groovy.document()
Creates the project's Jar files. This creates four Jar files. The main Jar, main source Jar, test Jar and test source Jar.
Here is an example of calling this method:
groovy.jar()
Creates a single Jar file by adding all of the files in the given directories.
Here is an example of calling this method:
groovy.jar(Paths.get("foo/bar.jar"), Paths.get("src/main/groovy"), Paths.get("some-other-dir"))
jarFile - The Jar file to create.directories - The directories to include in the Jar file.