【问题标题】:how to invoke all compile stages in sbt?如何调用 sbt 中的所有编译阶段?
【发布时间】:2015-05-09 22:21:34
【问题描述】:

我的项目中有maintestit(集成测试)Configs,跨多个模块。

我有一个根项目,允许我输入compiletest:compileit:compile 来编译每个阶段。

但是,我真的很想通过一次编译所有配置来最大化并行化。例如,测试和集成测试是互斥的,因此可以并行编译。

如何使用单个命令调用所有编译阶段?

【问题讨论】:

    标签: scala sbt


    【解决方案1】:

    您可以自己编写,使用默认情况下 sbt 任务是并行的这一事实:

    val compileAll = taskKey[Unit]("Run all compiles")
    compileAll := {
      val a = (compile in Compile).value
      val b = (compile in Test).value
      val c = (compile in IntegrationTest).value
      ()
    }
    

    【讨论】:

    • > compileAll [error] Not a valid command: compileAll (similar: completions) [error] Not a valid project ID: compileAll [error] Expected ':' (if selecting a configuration) [error] Not a valid key: compileAll (similar: compile, compilers, compileOrder) [error] compileAll [error] ^
    • 您的配置方式/位置一定有问题。
    猜你喜欢
    • 1970-01-01
    • 2015-04-30
    • 1970-01-01
    • 2017-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-23
    相关资源
    最近更新 更多