scala - 执行 sbt 命令时可以运行 scala 脚本吗?
问题描述
每当我们使用诸如“sbt compile”或“sbt assembly”之类的 sbt 命令时,我都想运行一个脚本。
有没有办法做到这一点?
解决方案
将步骤附加到任务的完成类似于以下内容:
compile <<= (compile in Compile) map {result =>
// whatever you want to do after compile here.
result
}
如果你想定义一个Command
运行你的脚本的自定义,那么在你的构建中定义一个命令,类似于
def myCommand = Command.command("myCommand") { state =>
s"<relative path to script here>" !; state
}
然后,您将添加myCommand
到您myCommand
想要运行的每个任务。
推荐阅读
- python - 具有部分识别模型的 Statsmodels
- delphi - 如何使 TJvCaptionPanel 按钮的外观现代化?
- python - AttributeError:模块“tkinter”没有属性“Tk__init__”
- javascript - 从 WebView 调用 Deno 函数。如何?
- python - 基于 pandas 数据框列的图形界面的代码逻辑
- typescript - 如何制作既可以选择又可以使属性只读的泛型类型?
- android - AdapterViewFlipper 与 StackView 卡片翻转动作
- laravel - 尝试使用 composer 安装 Laravel,它说“系统中缺少请求的 PHP 扩展文件信息”
- python - Scraping table header with Beautiful Soup
- powershell - 查找两个日期之间的数据