4.5 Command Tools Integration - Reference Documentation
Authors: Andres Almiray
Version: 1.2.0
4.5 Command Tools Integration
If all the other projects in your team or company are built using a standard build tool such as Ant or Maven, you become the black sheep of the family when you use the Griffon command line to build your application. Fortunately, you can easily integrate the Griffon build system into the main build tools in use today (well, the ones in use in Java projects at least).Ant Integration
When you invoke the integrate-with command with the -ant option enabledgriffon integrate-with --ant
build.xml
file for you containing the following targets:
clean
- Cleans the Griffon applicationdebug-app
- Runs the application in debug modetest
- Runs the unit testsrun-app
- Equivalent to "griffon run-app"run-applet
- Equivalent to "griffon run-applet"run-webstart
- Equivalent to "griffon run-webstart"dist
- Packages the application for production
ant clean
<taskdef name="griffonTask" classname="griffon.ant.GriffonTask" classpathref="griffon.classpath"/>
Attribute | Description | Required |
---|---|---|
home | The location of the Griffon installation directory to use for the build. | Yes, unless classpath is specified. |
classpathref | Classpath to load Griffon from. Must include the "griffon-bootstrap" artifact and should include "griffon-scripts". | Yes, unless home is set or you use a classpath element. |
script | The name of the Griffon script to run, e.g. "TestApp". | Yes. |
args | The arguments to pass to the script, e.g. "-unit -xml". | No. Defaults to "". |
environment | The Griffon environment to run the script in. | No. Defaults to the script default. |
includeRuntimeClasspath | Advanced setting: adds the application's runtime classpath to the build classpath if true. | No. Defaults to true. |
classpath
- The build classpath (used to load Gant and the Griffon scripts).compileClasspath
- Classpath used to compile the application's classes.runtimeClasspath
- Classpath used to run the application and package the WAR. Typically includes everything in @compileClasspath.testClasspath
- Classpath used to compile and run the tests. Typically includes everything inruntimeClasspath
.
home
attribute and put your own dependencies in the lib
directory, then you don't even need to use any of them. For an example of their use, take a look at the generated Ant build file for new apps.Maven Integration
TBDGradle Integration
When you invoke the integrate-with command with the -gradle option enabledgriffon integrate-with --gradle
build.gradle
file for you. From here you can call the standard Gradle commands such as clean
, assemble
and build
to build your application. You can also use griffon
as a command prefix to execute any of the regular Griffon command targets such asgradle griffon-run-webstart
clean
- Cleans the Griffon applicationcompile
- Equivalent to "griffon compile"test
- Runs all application testsrun-app
- Equivalent to "griffon run-app"assemble
- Equivalent to "griffon package"