Helper class that allows a client to bootstrap the Grails build system in its own class loader. It basically uses reflection to handle the entry points to the build system: BuildSettings and GrailsScriptRunner. This ensures class loader isolation for Grails.
Constructor and description |
---|
GrailsBuildHelper
(java.lang.ClassLoader classLoader) Creates a helper that loads the Grails build system with the given class loader. |
GrailsBuildHelper
(java.lang.ClassLoader classLoader, java.lang.String grailsHome) Creates a helper that loads the Grails build system with the given class loader. |
GrailsBuildHelper
(java.lang.ClassLoader classLoader, java.lang.String grailsHome, java.lang.String baseDir) |
Type Params | Return Type | Name and description |
---|---|---|
|
int |
execute(java.lang.String script) Executes the named Grails script with no arguments. |
|
int |
execute(java.lang.String script, java.lang.String args) Executes the named Grails script with the given arguments. |
|
int |
execute(java.lang.String script, java.lang.String args, java.lang.String env) Executes the named Grails script with the given arguments in the specified environment. |
|
java.io.File |
getClassesDir() |
|
java.util.List |
getCompileDependencies() |
|
java.io.File |
getGlobalPluginsDir() |
|
java.io.File |
getGrailsWorkDir() |
|
java.io.File |
getProjectPluginsDir() |
|
java.io.File |
getProjectWorkDir() |
|
java.io.File |
getResourcesDir() |
|
java.util.List |
getRuntimeDependencies() |
|
java.io.File |
getTestClassesDir() |
|
java.util.List |
getTestDependencies() |
|
java.io.File |
getTestReportsDir() |
|
void |
setBuildDependencies(java.util.List dependencies) |
|
void |
setClassesDir(java.io.File dir) |
|
void |
setCompileDependencies(java.util.List dependencies) |
|
void |
setDependenciesExternallyConfigured(boolean b) |
|
void |
setGlobalPluginsDir(java.io.File dir) |
|
void |
setGrailsWorkDir(java.io.File dir) |
|
void |
setProjectPluginsDir(java.io.File dir) |
|
void |
setProjectWorkDir(java.io.File dir) |
|
void |
setResourcesDir(java.io.File dir) |
|
void |
setRuntimeDependencies(java.util.List dependencies) |
|
void |
setTestClassesDir(java.io.File dir) |
|
void |
setTestDependencies(java.util.List dependencies) |
|
void |
setTestReportsDir(java.io.File dir) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Creates a helper that loads the Grails build system with the given class loader. Ideally, the class loader should be an instance of GrailsRootLoader. You can try other class loaders, but you may run into problems.
classLoader
- The class loader that will be used to load Grails.Creates a helper that loads the Grails build system with the given class loader. Ideally, the class loader should be an instance of GrailsRootLoader. You can try other class loaders, but you may run into problems.
classLoader
- The class loader that will be used to load Grails.grailsHome
- Location of a local Grails installation.Executes the named Grails script with no arguments.
script
- The name of the script to execute, such as "Compile".Executes the named Grails script with the given arguments.
script
- The name of the script to execute, such as "Compile".args
- A single string containing the arguments for the
script, each argument separated by whitespace.Executes the named Grails script with the given arguments in the specified environment. Normally the script is run in the default environment for that script.
script
- The name of the script to execute, such as "Compile".args
- A single string containing the arguments for the
script, each argument separated by whitespace.env
- The name of the environment to run in, e.g. "development"
or "production".