gpt4 book ai didi

grails - 在哪里可以找到 grails 的构建生命周期事件列表?

转载 作者:行者123 更新时间:2023-12-04 08:25:23 28 4
gpt4 key购买 nike

是否有一个列表或某种方法可以挖掘核心构建系统触发的所有事件(即,您可以在 _Events.groovy 脚本中监听的内容?grails 文档列出了一些“常见”事件——是否没有列表“全部”?

(我知道你可以创建额外的事件,而且插件经常会这样做——所以没有这些事件的完整列表——我只是询问那些可以由外的——所有标准构建操作的框 Grails 安装。)

最佳答案

斯科特戴维斯实际上 suggests在他关于 Grails 事件模型的帖子中找到了一种方法。但是,他的方法只会在单个目录中查找脚本。

假设您在 UNIX 系统上,您可以 cd 进入您的 $GRAILS_HOME 目录并运行 grep "event(" */**.groovy找到触发事件的所有核心脚本。

这是来自我的 Grails 2.3.3 目录的示例输出。

只是事件字符串

  • StatusFinal
  • 创建文件
  • 状态更新
  • 状态错误
  • 状态更新
  • IntegrateWithInit
  • 状态错误
  • 状态错误
  • 状态更新
  • 状态更新
  • 状态错误
  • StatusFinal
  • StatusFinal
  • StatsStart
  • 状态更新
  • 状态更新
  • 状态更新
  • StatusFinal
  • AppLoadEnd
  • AppCfgEnd
  • 状态错误
  • 状态错误
  • 状态错误
  • 创建文件
  • CreatedArtefact
  • StatusFinal
  • StatusFinal
  • DocSkip
  • 文档开始
  • 状态错误
  • DocEnd
  • DocSkip
  • 文档开始
  • 状态错误
  • DocEnd
  • DocSkip
  • 文档开始
  • DocEnd
  • DocSkip
  • 文档开始
  • DocEnd
  • 设置类路径
  • StatusFinal
  • StatusFinal
  • 包装完
  • PackagePluginStart
  • 包插件结束
  • 状态更新
  • 状态错误

  • 完整的 grep 输出
    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])

    关于grails - 在哪里可以找到 grails 的构建生命周期事件列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23394989/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com