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.sbtyou 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.scalayou can define your Task. For example:Then, in your
build.sbtyou can write:Then you can invoke your proper
sbt mySuperDuperCommand.Hope it helps!