Skip to content

Instantly share code, notes, and snippets.

@xymor
Created May 30, 2011 14:50
Show Gist options
  • Save xymor/999002 to your computer and use it in GitHub Desktop.
Save xymor/999002 to your computer and use it in GitHub Desktop.
Grails Event.groovy
Ant.property (environment:'env')
eventStatusInterrupt = { args ->
println "Caught interruption"
println args
}
//eventStatusUpdate = { msg -> popUpMessage(args) }
eventStatusFinal = { args -> popUpMessage(args) }
//eventAppLoadEnd = { args -> popUpMessage(args) }
eventConfigureJetty = { args -> popUpMessage(args) }
//eventTestPhaseEnd = { args -> popUpMessage(args) }
def popUpMessage(msg){
def grailsHome = Ant.antProject.properties."env.GRAILS_HOME" ?: System.getProperty("grails.home")
if(new File('/usr/bin/notify-send').exists()){
Ant.exec(executable:"/usr/bin/notify-send",os:"Linux") {
arg(value:"--icon=${grailsHome}/media/icons/favicon48.png")
arg(value:"Grails")
arg(value:"$msg")
}
}
Ant.exec(executable:"/usr/local/bin/growlnotify",os:"Mac OS X") {
arg(value:"-m 'Grails: ${msg}")
arg(value:"--image '${grailsHome}/media/icons/favicon48.png'")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment