Created
May 30, 2011 14:50
-
-
Save xymor/999002 to your computer and use it in GitHub Desktop.
Grails Event.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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