Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A demonstration app for the Grails 1.2 build listening feature.
Shell CSS Groovy Gosu
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
grails-app
scripts
src
test
web-app
wrapper
.gitignore
README.md
application.properties
grailsw
grailsw.bat

README.md

This app demonstrates the new “Build Listening” feature of Grails 1.2.

Implementations of GrailsBuildListener can be injected into the build in 3 different ways

A very trivial implementation is included in this project as LoggingGrailsBuildListener. This implementation simply logs all events to buildEvents.log in the project directory.

Registration

System Property

To try it out, run…

./grailsw -Dgrails.build.listeners=LoggingGrailsBuildListener test-app

The property value is a comma separated list of class names (that implement GrailsBuildListener).

BuildConfig

Listeners can be set in grails-app/conf/BuildConfig.groovy. Check out that file in this project.

To try it out, run…

./grailsw compile

To make sure that LoggingGrailsBuildListener is available, then uncomment out…

//grails.build.listeners='LoggingGrailsBuildListener'

in BuildConfig.groovy, then run any grails command.

Programmatic

Listeners can be registered during the build. See scripts/TestAppWithListener.groovy in this project for an example of how to do so.

To try it out, run…

./grailsw compile

To make sure that LoggingGrailsBuildListener is available, then run…

./grailsw test-app-with-listener

Test Events

Grails 1.2 adds a “test event publishing” contract to ensure that all test types publish suitable events to inform interested parties on what is happening. The most obvious usage of this would be for an IDE to provide rich visual feedback of test execution.

Test types call an instance of GrailsTestEventPublisher to publish events during test execution into the Grails build system.

An IDE could inject a listener via the grails.build.listeners system property, that communicates back with the IDE somehow. It could respond appropriately to the test event published by GrailsTestEventPublisher.

Something went wrong with that request. Please try again.