Ani*_* B. 0 scala sbt playframework
当我从终端运行命令时:sbt run
它像这样登录控制台:
[info] welcome to sbt 1.3.13 (Azul Systems, Inc. Java 1.8.0_362)
[info] loading global plugins from /.sbt/1.0/plugins
[info] loading settings for project from plugins.sbt ...
[info] loading project definition from /demo/project
[info] loading settings for project root from build.sbt ...
[info] __ __
[info] \ \ ____ / /____ _ __ __
[info] \ \ / __ \ / // __ `// / / /
[info] / / / /_/ // // /_/ // /_/ /
[info] /_/ / .___//_/ \__,_/ \__, /
[info] /_/ /____/
[info]
[info] Version 2.8.18 running Java 1.8.0_362
[info]
[info] Play is run entirely by the community. Please consider contributing and/or donating:
[info] https://www.playframework.com/sponsors
Run Code Online (Sandbox Code Playgroud)
现在,我想将下面的默认横幅修改为自定义横幅。
[info] __ __
[info] \ \ ____ / /____ _ __ __
[info] \ \ / __ \ / // __ `// / / /
[info] / / / /_/ // // /_/ // /_/ /
[info] /_/ / .___//_/ \__,_/ \__, /
[info] /_/ /____/
[info]
Run Code Online (Sandbox Code Playgroud)
还可以修改吗?如果是,请说明如何做。
覆盖项目的build.sbtonLoadMessage中的密钥:
import play.sbt.Colors
onLoadMessage := {
"""| __ __
| \ \ ____ / /____ _ __ __
| \ \ / __ \ / // __ `// / / /
| / / / /_/ // // /_/ // /_/ /
| /_/ / .___//_/ \__,_/ \__, /
| /_/ /____/
|""".stripMargin.linesIterator.map(Colors.green(_)).mkString("\n")
}
Run Code Online (Sandbox Code Playgroud)
如果您想要为您的贡献者提供自定义横幅,我个人更喜欢使用sbt-welcome为用户提供一些不错的欢迎消息、有用的任务以及如何开始使用代码的提示。onLoadMessage它将使用某种结构化格式进行设置。