|
Griffon 1.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
griffon.ant.GriffonTask
public class GriffonTask extends Task
Ant task for executing Griffon scripts. To use it, first create a task definition for it:
<path id="griffon.classpath"> <fileset dir="${griffon.home}/dist" includes="griffon-cli-0.4.jar"/> <fileset dir="${griffon.home}/lib" includes="groovy-all-1.7.2.jar"/> </path> <taskdef name="griffon" classname="griffon.ant.GriffonTask" classpathref="griffon.classpath"/>You must have both the "griffon-cli" and "groovy-all" JARs on the
taskdef's classpath, otherwise the task won't load.
Once the task is defined, you can use it like this:
<griffon home="${griffon.home}" script="Clean"/>
The home
attribute contains the location of a local
Griffon installation, while script
is the name of the
Griffon script to run. Note that it's the script name not
the equivalent command name.
If you want to use the Ant task without a Griffon installation,
then you can use the classpathref
attribute or
classpath
nested element instead of home
.
This allows you to control precisely which JARs and versions are
used to execute the Griffon scripts. Typically you would use this
option in conjunction with something like Ivy.
Field Summary
private String
args
private Path
classpath
private Path
compileClasspath
private String
environment
private File
home
private boolean
includeRuntimeClasspath
private Path
runtimeClasspath
private String
script
private Path
testClasspath
Constructor Summary
GriffonTask()
Method Summary
void
addClasspath(Path classpath)
void
addCompileClasspath(Path compileClasspath)
void
addRuntimeClasspath(Path runtimeClasspath)
void
addTestClasspath(Path testClasspath)
void
execute()
String
getArgs()
Path
getClasspath()
String
getCommand()
Path
getCompileClasspath()
String
getEnvironment()
File
getHome()
private List
getRequiredLibsFromHome()
Path
getRuntimeClasspath()
String
getScript()
Path
getTestClasspath()
boolean
isIncludeRuntimeClasspath()
private List
pathsToUrls(Path path)
protected void
runGriffon(String targetName, String args)
void
setArgs(String args)
void
setClasspathRef(Reference ref)
void
setCommand(String command)
void
setEnvironment(String environment)
void
setHome(File home)
void
setIncludeRuntimeClasspath(boolean includeRuntimeClasspath)
void
setScript(String script)
Methods inherited from class Task
log, log, log, log, init, execute, getOwningTarget, getTaskName, getTaskType, setTaskType, setTaskName, setOwningTarget, getRuntimeConfigurableWrapper, setRuntimeConfigurableWrapper, maybeConfigure, reconfigure, perform, bindToOwner, clone, getLocation, setLocation, getDescription, setDescription, getProject, setProject, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
Methods inherited from class ProjectComponent
clone, log, log, getLocation, setLocation, getDescription, setDescription, getProject, setProject, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
Field Detail
args
private String args
-
classpath
private Path classpath
-
compileClasspath
private Path compileClasspath
-
environment
private String environment
-
home
private File home
-
includeRuntimeClasspath
private boolean includeRuntimeClasspath
-
runtimeClasspath
private Path runtimeClasspath
-
script
private String script
-
testClasspath
private Path testClasspath
-
Constructor Detail
GriffonTask
GriffonTask()
-
Method Detail
addClasspath
public void addClasspath(@SuppressWarnings("hiding") Path classpath)
-
addCompileClasspath
@Deprecated
public void addCompileClasspath(@SuppressWarnings("hiding") Path compileClasspath)
-
addRuntimeClasspath
@Deprecated
public void addRuntimeClasspath(@SuppressWarnings("hiding") Path runtimeClasspath)
-
addTestClasspath
@Deprecated
public void addTestClasspath(@SuppressWarnings("hiding") Path testClasspath)
-
execute
@Override
public void execute()
-
getArgs
public String getArgs()
-
getClasspath
public Path getClasspath()
-
getCommand
public String getCommand()
-
getCompileClasspath
@Deprecated
public Path getCompileClasspath()
-
getEnvironment
public String getEnvironment()
-
getHome
public File getHome()
-
getRequiredLibsFromHome
private List getRequiredLibsFromHome()
-
getRuntimeClasspath
@Deprecated
public Path getRuntimeClasspath()
-
getScript
public String getScript()
-
getTestClasspath
@Deprecated
public Path getTestClasspath()
-
isIncludeRuntimeClasspath
public boolean isIncludeRuntimeClasspath()
-
pathsToUrls
private List pathsToUrls(Path path)
-
runGriffon
protected void runGriffon(String targetName, @SuppressWarnings("hiding") String args)
-
setArgs
public void setArgs(String args)
-
setClasspathRef
public void setClasspathRef(Reference ref)
-
setCommand
public void setCommand(String command)
-
setEnvironment
public void setEnvironment(String environment)
-
setHome
public void setHome(File home)
-
setIncludeRuntimeClasspath
public void setIncludeRuntimeClasspath(boolean includeRuntimeClasspath)
-
setScript
public void setScript(String script)
-
Groovy Documentation