Package: org.codehaus.groovy.grails.cli.support

## [Java] Class GrailsBuildHelper

- org.codehaus.groovy.grails.cli.support.GrailsBuildHelper

- 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.

  Authors:
    Peter Ledbrook

- - ### Constructor Summary

    Constructors
    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)`

  - ### Methods Summary

    Methods
    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)`

  - ### Inherited Methods Summary

    Inherited Methods
    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()`

- - ### Constructor Detail

    - #### public GrailsBuildHelper(java.lang.ClassLoader classLoader)

      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.

      Parameters:
        `classLoader` - The class loader that will be used to load Grails.

    - #### public GrailsBuildHelper(java.lang.ClassLoader classLoader, java.lang.String grailsHome)

      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.

      Parameters:
        `classLoader` - The class loader that will be used to load Grails.
        `grailsHome` - Location of a local Grails installation.

    - #### public GrailsBuildHelper(java.lang.ClassLoader classLoader, java.lang.String grailsHome, java.lang.String baseDir)

  - ### Method Detail

    - #### public int execute(java.lang.String script)

      Executes the named Grails script with no arguments.

      Parameters:
        `script` - The name of the script to execute, such as "Compile".
      Returns:
        The value returned by the build system (notionally the exit code).

    - #### public int execute(java.lang.String script, java.lang.String args)

      Executes the named Grails script with the given arguments.

      Parameters:
        `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.
      Returns:
        The value returned by the build system (notionally the exit code).

    - #### public 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. Normally the script is run in the default environment for that script.

      Parameters:
        `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".
      Returns:
        The value returned by the build system (notionally the exit code).

    - #### public java.io.File getClassesDir()

    - #### @java.lang.SuppressWarnings("rawtypes") public java.util.List getCompileDependencies()

    - #### public java.io.File getGlobalPluginsDir()

    - #### public java.io.File getGrailsWorkDir()

    - #### public java.io.File getProjectPluginsDir()

    - #### public java.io.File getProjectWorkDir()

    - #### public java.io.File getResourcesDir()

    - #### @java.lang.SuppressWarnings("rawtypes") public java.util.List getRuntimeDependencies()

    - #### public java.io.File getTestClassesDir()

    - #### @java.lang.SuppressWarnings("rawtypes") public java.util.List getTestDependencies()

    - #### public java.io.File getTestReportsDir()

    - #### @java.lang.SuppressWarnings("rawtypes") public void setBuildDependencies(java.util.List dependencies)

    - #### public void setClassesDir(java.io.File dir)

    - #### @java.lang.SuppressWarnings("rawtypes") public void setCompileDependencies(java.util.List dependencies)

    - #### public void setDependenciesExternallyConfigured(boolean b)

    - #### public void setGlobalPluginsDir(java.io.File dir)

    - #### public void setGrailsWorkDir(java.io.File dir)

    - #### public void setProjectPluginsDir(java.io.File dir)

    - #### public void setProjectWorkDir(java.io.File dir)

    - #### public void setResourcesDir(java.io.File dir)

    - #### @java.lang.SuppressWarnings("rawtypes") public void setRuntimeDependencies(java.util.List dependencies)

    - #### public void setTestClassesDir(java.io.File dir)

    - #### @java.lang.SuppressWarnings("rawtypes") public void setTestDependencies(java.util.List dependencies)

    - #### public void setTestReportsDir(java.io.File dir)