Search code examples
sbttypesafe-activator

Migrate from activator 0.13.x to sbt 1.x


I am migrating from activator from 0.13.x to sbt 1.x.

I used to compile my modules like this $ activator clean compile publish-local -Dversion=1

Now, I am trying to do it with sbt since activator has been deprecated, but I can not find how I should migrate to something similar like $ sbt clean compile publish-local -Dversion=1?


Solution

  • Activator (the CLI part) was just a wrapper around sbt with some custom commands. So what you wrote should work the same, expect that the snake-case was deprecated in favor of the camelCase:

    sbt clean compile publishLocal
    

    If you need to pass a var to the Java runtime with -D you have to place it before any commands: sbt -Dversion=1 ....

    Notice that you use batch mode to run the commands:

    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.

    To follow this recommendation, just run sbt and then enter those commands one by one. Or to run them all sequentially, enter ; clean; compile; publishLocal.