是否有列表或某种方式来挖掘核心构建系统触发的所有事件(即,您可以在_Events.groovy脚本中监听的内容?grails文档列出了一些"常见&#34 ;那些 - 没有"所有"的列表?
(我知道你可以创建额外的活动,而插件经常会这样做 - 所以没有这些事件的全面列表 - 我只是询问那些可能是由开箱即用的Grails安装引发,用于所有标准构建操作。)
答案 0 :(得分:5)
假设您使用的是UNIX系统,则可以进入$ GRAILS_HOME目录并运行grep "event(" */**.groovy
以查找触发事件的所有核心脚本。
这是我的Grails 2.3.3目录中的示例输出。
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])