Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find a list of build lifecycle events for grails?

Tags:

grails

Is there a list or some way to excavate for all the events that the core build system fires (i.e., things you can listen for in a _Events.groovy script? The grails docs list a few "common" ones -- is there no list of "all" of them?

(I know you can create additional events, and that plugins often do -- so there's no such thing as a comprehensive list of these events -- I'm just asking about the ones that can be thrown by an out-of-the-box Grails installation for all the standard build operations.)

like image 778
npskirk Avatar asked Apr 30 '14 18:04

npskirk


1 Answers

Scott Davis actually suggests a method for finding this out in his post on the Grails event model. However, his method will only find scripts in a single directory.

Assuming you're on a UNIX system, you can cd into your $GRAILS_HOME directory and run grep "event(" */**.groovy to find all the core scripts that fire an event.

Here's a sample output from my Grails 2.3.3 directory.

Just the Event Strings

  • StatusFinal
  • CreatedFile
  • StatusUpdate
  • StatusError
  • StatusUpdate
  • IntegrateWithInit
  • StatusError
  • StatusError
  • StatusUpdate
  • StatusUpdate
  • StatusError
  • StatusFinal
  • StatusFinal
  • StatsStart
  • StatusUpdate
  • StatusUpdate
  • StatusUpdate
  • StatusFinal
  • AppLoadEnd
  • AppCfgEnd
  • StatusError
  • StatusError
  • StatusError
  • CreatedFile
  • CreatedArtefact
  • StatusFinal
  • StatusFinal
  • DocSkip
  • DocStart
  • StatusError
  • DocEnd
  • DocSkip
  • DocStart
  • StatusError
  • DocEnd
  • DocSkip
  • DocStart
  • DocEnd
  • DocSkip
  • DocStart
  • DocEnd
  • SetClasspath
  • StatusFinal
  • StatusFinal
  • PackagingEnd
  • PackagePluginStart
  • PackagePluginEnd
  • StatusUpdate
  • StatusError

Full grep Output

scripts/BugReport.groovy:    event("StatusFinal", ["Created bug-report ZIP at $zipName"])
scripts/CreateController.groovy:        event("CreatedFile", [viewsDir])
scripts/InstallAppTemplates_.groovy:    event('StatusUpdate', ["Application templates installed to $destination"])
scripts/InstallPlugin.groovy:            event("StatusError", [ ERROR_MESSAGE])
scripts/InstallTemplates.groovy:    event("StatusUpdate", ["Templates installed successfully"])
scripts/IntegrateWith.groovy:        event("IntegrateWithInit", keys.toList())
scripts/PluginInfo_.groovy:        event("StatusError", ["Usage: grails plugin-info <plugin-name> [version]"])
scripts/RunScript.groovy:        event('StatusError', ['ERROR: Required script name parameter is missing'])
scripts/RunScript.groovy:            event('StatusUpdate', ["Running script $scriptFile ..."])
scripts/RunScript.groovy:            event('StatusUpdate', ["Script $scriptFile complete!"])
scripts/RunScript.groovy:        event('StatusError', ["Designated script doesn't exist: $scriptFile"])
scripts/SetVersion.groovy:        event("StatusFinal", [ "Plugin version updated to $newVersion"])
scripts/SetVersion.groovy:        event("StatusFinal", [ "Application version updated to $newVersion"])
scripts/Stats.groovy:    event("StatsStart", [pathToInfo])
scripts/Upgrade.groovy:        event("StatusUpdate", ["NOTE: Your application currently expects grails version [$gv], " +
scripts/Upgrade.groovy:            event("StatusUpdate", ["Executing ${pluginDir.getFilename()} plugin upgrade script"])
scripts/Upgrade.groovy:    event("StatusUpdate", ["Please make sure you view the README for important information about changes to your source code."])
scripts/Upgrade.groovy:    event("StatusFinal", ["Project upgraded"])
scripts/_GrailsBootstrap.groovy:    event("AppLoadEnd", ["Loading Grails Application"])
scripts/_GrailsBootstrap.groovy:    event("AppCfgEnd", ["Configuring Grails Application"])
scripts/_GrailsCompile.groovy:            event("StatusError", ["Compilation error: ${e.cause.message}"])
scripts/_GrailsCompile.groovy:            event("StatusError", ["GSP Compilation error in file $e.cause.fileName at line $e.cause.lineNumber: $e.cause.message"])
scripts/_GrailsCompile.groovy:            event("StatusError", ["Compilation error: ${e.cause?.message ?: e.message}"])
scripts/_GrailsCreateArtifacts.groovy:    event("CreatedFile", [artifactFile])
scripts/_GrailsCreateArtifacts.groovy:    event("CreatedArtefact", [ artifactFile, className])
scripts/_GrailsCreateProject.groovy:    event("StatusFinal", ["Created Grails Application at ${new File(basedir).canonicalPath}"])
scripts/_GrailsCreateProject.groovy:    event("StatusFinal", [ "Created plugin ${pluginName}" ])
scripts/_GrailsDocs.groovy:        event("DocSkip", ['groovydoc'])
scripts/_GrailsDocs.groovy:    event("DocStart", ['groovydoc'])
scripts/_GrailsDocs.groovy:        event("StatusError", ["Error generating groovydoc: ${e.message}"])
scripts/_GrailsDocs.groovy:    event("DocEnd", ['groovydoc'])
scripts/_GrailsDocs.groovy:        event("DocSkip", ['javadoc'])
scripts/_GrailsDocs.groovy:    event("DocStart", ['javadoc'])
scripts/_GrailsDocs.groovy:            event("StatusError", ["Error generating javadoc: ${e.message}"])
scripts/_GrailsDocs.groovy:    event("DocEnd", ['javadoc'])
scripts/_GrailsDocs.groovy:        event("DocSkip", ["refdocs"])
scripts/_GrailsDocs.groovy:        event("DocStart", ["refdocs"])
scripts/_GrailsDocs.groovy:        event("DocEnd", ["refdocs"])
scripts/_GrailsDocs.groovy:        event("DocSkip", ['pdf'])
scripts/_GrailsDocs.groovy:    event("DocStart", ['pdf'])
scripts/_GrailsDocs.groovy:    event("DocEnd", ['pdf'])
scripts/_GrailsEvents.groovy:event('SetClasspath', [classLoader])
scripts/_GrailsInit.groovy:            event("StatusFinal", ["Application expects grails version [$appGrailsVersion], but GRAILS_HOME is version " +
scripts/_GrailsInit.groovy:        event("StatusFinal", ["Application metadata not found, please run: grails upgrade"])
scripts/_GrailsPackage.groovy:    event("PackagingEnd",[])
scripts/_GrailsPluginDev.groovy:    event("PackagePluginStart", [pluginInfo.name])
scripts/_GrailsPluginDev.groovy:    event("PackagePluginEnd", [pluginInfo.name])
scripts/_GrailsWrapper.groovy:    event("StatusUpdate", [ "Wrapper installed successfully"])
scripts/_PluginDependencies.groovy:    pluginInstallEngine.eventHandler = { eventName, msg -> event(eventName, [msg]) }
scripts/_PluginDependencies.groovy:        event("StatusError", [msg])
like image 163
jonnybot Avatar answered Nov 16 '22 02:11

jonnybot