加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何执行bash脚本作为sbt任务?

发布时间:2020-12-15 18:53:37 所属栏目:安全 来源:网络整理
导读:我想自动为我的Java Play 2.3应用程序构建文档. 目前,我使用Makefile从* .dotfiles生成图像,并将Markdown源组合到Html / PDF中: dot diagram1.dot -Tpdf -o diagram1.pdfdot diagram2.dot -Tpdf -o diagram2.pdfpandoc doc1.markdown -o doc1.pdf# ... 现在



我想自动为我的Java Play 2.3应用程序构建文档.
目前,我使用Makefile从* .dotfiles生成图像,并将Markdown源组合到Html / PDF中:
dot diagram1.dot -Tpdf -o diagram1.pdf
dot diagram2.dot -Tpdf -o diagram2.pdf
pandoc doc1.markdown -o doc1.pdf
# ...

现在我想直接从SBT运行这些简单的bash命令.
最好的方式是做什么?

我在SBT参考中发现了一些SBT Documentation plugins,但没有运行一个简单的shell脚本.

您可以在s000的官方文档中找到 External Processes中的一些答案,例如

To run an external command,follow it with an exclamation mark !:

06000

在启动器控制台(也称为sbt shell)中执行以下操作来执行yourshell.sh – 记住eval命令和脚本名称周围的引号:

eval "yourshell.sh" !

要将其作为任务可用,请将以下内容添加到您的项目的build.sbt中:

lazy val execScript = taskKey[Unit]("Execute the shell script")

execScript := {
  "yourshell.sh" !
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读