Skip to content

ldaley/grails-build-listening

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A demonstration app for the Grails 1.2 build listening feature.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published