I'm trying to add a new command to my sbt.
In my build.sbt
I have
lazy val root = (project in file(".")).settings(mySuperDuperCommand)
In a sibling file mySuperDuperCommands.sbt
I have
lazy val mySuperDuperTaskKey = TaskKey[Unit]("mySuperDuperCommand")
lazy val mySuperDuperCommand := { ... do *amazing* stuff ... }
It gives me the error cannot resolve symbol "mySuperDuperCommand"
inside build.sbt
. How to solve this conondrum?
If you like to stay with a single build file then, in your
build.sbt
you can do:of course by replacing
...
with your own task implementation.Alternatively, if you prefer to use two different files you can do something like this:
In
project/Build.scala
you can define your Task. For example:Then, in your
build.sbt
you can write:Then you can invoke your proper
sbt mySuperDuperCommand
.Hope it helps!