Griffon 1.2.0

org.codehaus.griffon.cli.support
[Java] Class GriffonBuildHelper

java.lang.Object
  org.codehaus.griffon.cli.support.GriffonBuildHelper

public class GriffonBuildHelper

Helper class that allows a client to bootstrap the Griffon build system in its own class loader. It basically uses reflection to handle the entry points to the build system: BuildSettings and GriffonScriptRunner. This ensures class loader isolation for Griffon.

Authors:
Peter Ledbrook


Field Summary
private ClassLoader classLoader

private Object settings

 
Constructor Summary
GriffonBuildHelper(ClassLoader classLoader)

Creates a helper that loads the Griffon build system with the given class loader.

GriffonBuildHelper(ClassLoader classLoader, String griffonHome)

Creates a helper that loads the Griffon build system with the given class loader.

GriffonBuildHelper(ClassLoader classLoader, String griffonHome, String baseDir)

 
Method Summary
private Object createScriptRunner()

int execute(String script)

Executes the named Griffon script with no arguments.

int execute(String script, String args)

Executes the named Griffon script with the given arguments.

int execute(String script, String args, String env)

Executes the named Griffon script with the given arguments in the specified environment.

File getClassesDir()

List getCompileDependencies()

File getGriffonWorkDir()

File getProjectPluginsDir()

File getProjectWorkDir()

File getResourcesDir()

List getRuntimeDependencies()

File getTestClassesDir()

List getTestDependencies()

File getTestReportsDir()

File getTestResourcesDir()

private Object invokeMethod(Object target, String name, Object[] args)

Invokes the named method on a target object using reflection.

private Object invokeMethod(Object target, String name, Class[] argTypes, Object[] args)

Invokes the named method on a target object using reflection.

void setClassesDir(File dir)

void setCompileDependencies(List dependencies)

void setDependenciesExternallyConfigured(boolean b)

void setGriffonWorkDir(File dir)

void setProjectPluginsDir(File dir)

void setProjectWorkDir(File dir)

void setResourcesDir(File dir)

void setRuntimeDependencies(List dependencies)

void setTestClassesDir(File dir)

void setTestDependencies(List dependencies)

void setTestReportsDir(File dir)

void setTestResourcesDir(File dir)

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

classLoader

private ClassLoader classLoader


settings

private Object settings


 
Constructor Detail

GriffonBuildHelper

public GriffonBuildHelper(ClassLoader classLoader)
Creates a helper that loads the Griffon build system with the given class loader. Ideally, the class loader should be an instance of GriffonRootLoader. You can try other class loaders, but you may run into problems.
Parameters:
classLoader - The class loader that will be used to load Griffon.


GriffonBuildHelper

public GriffonBuildHelper(ClassLoader classLoader, String griffonHome)
Creates a helper that loads the Griffon build system with the given class loader. Ideally, the class loader should be an instance of GriffonRootLoader. You can try other class loaders, but you may run into problems.
Parameters:
classLoader - The class loader that will be used to load Griffon.
griffonHome - Location of a local Griffon installation.


GriffonBuildHelper

public GriffonBuildHelper(ClassLoader classLoader, String griffonHome, String baseDir)


 
Method Detail

createScriptRunner

private Object createScriptRunner()


execute

public int execute(String script)
Executes the named Griffon 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).


execute

public int execute(String script, String args)
Executes the named Griffon 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).


execute

public int execute(String script, String args, String env)
Executes the named Griffon 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).


getClassesDir

public File getClassesDir()


getCompileDependencies

public List getCompileDependencies()


getGriffonWorkDir

public File getGriffonWorkDir()


getProjectPluginsDir

public File getProjectPluginsDir()


getProjectWorkDir

public File getProjectWorkDir()


getResourcesDir

public File getResourcesDir()


getRuntimeDependencies

public List getRuntimeDependencies()


getTestClassesDir

public File getTestClassesDir()


getTestDependencies

public List getTestDependencies()


getTestReportsDir

public File getTestReportsDir()


getTestResourcesDir

public File getTestResourcesDir()


invokeMethod

private Object invokeMethod(Object target, String name, Object[] args)
Invokes the named method on a target object using reflection. The method signature is determined by the classes of each argument.
Parameters:
target - The object to call the method on.
name - The name of the method to call.
args - The arguments to pass to the method (may be an empty array).
Returns:
The value returned by the method.


invokeMethod

private Object invokeMethod(Object target, String name, Class[] argTypes, Object[] args)
Invokes the named method on a target object using reflection. The method signature is determined by given array of classes.
Parameters:
target - The object to call the method on.
name - The name of the method to call.
argTypes - The argument types declared by the method we want to invoke (may be an empty array for a method that takes no arguments).
args - The arguments to pass to the method (may be an empty array).
Returns:
The value returned by the method.


setClassesDir

public void setClassesDir(File dir)


setCompileDependencies

public void setCompileDependencies(List dependencies)


setDependenciesExternallyConfigured

public void setDependenciesExternallyConfigured(boolean b)


setGriffonWorkDir

public void setGriffonWorkDir(File dir)


setProjectPluginsDir

public void setProjectPluginsDir(File dir)


setProjectWorkDir

public void setProjectWorkDir(File dir)


setResourcesDir

public void setResourcesDir(File dir)


setRuntimeDependencies

public void setRuntimeDependencies(List dependencies)


setTestClassesDir

public void setTestClassesDir(File dir)


setTestDependencies

public void setTestDependencies(List dependencies)


setTestReportsDir

public void setTestReportsDir(File dir)


setTestResourcesDir

public void setTestResourcesDir(File dir)


 

Groovy Documentation