从激活器 0.13.x 迁移到 sbt 1.x

Migrate from activator 0.13.x to sbt 1.x

我正在从激活器从 0.13.x 迁移到 sbt 1.x.

我曾经这样编译我的模块$ activator clean compile publish-local -Dversion=1

现在,我正在尝试使用 sbt,因为激活器已被弃用,但我找不到如何迁移到类似 $ sbt clean compile publish-local -Dversion=1?

的东西

Activator(CLI 部分)只是带有一些自定义命令的 sbt 包装器。所以你写的应该是一样的,期望 snake-case 被弃用以支持 camelCase:

sbt clean compile publishLocal

如果您需要使用 -D 将 var 传递给 Java 运行time,您必须将其放在任何命令之前:sbt -Dversion=1 ....

请注意,您使用 batch mode 来 运行 命令:

Running in batch mode requires JVM spinup and JIT each time, so your build will run much slower. For day-to-day coding, we recommend using the sbt shell or Continuous build and test feature described below.

要遵循此建议,只需 运行 sbt 然后一一输入这些命令。或者按顺序 运行 它们,输入 ; clean; compile; publishLocal.