1

I have my build.sbt file like this:

./build.sbt

lazy val root = (project in file(".")
  .settings(libraryDependencies ++= Seq(...))

and a second file (in the same folder) like this:

./release.sbt

lazy val releaseStuff: Def.Setting[Task[Unit]] = DockerSbtPlugin.releaseStuff
lazy val root = (project in file(".").settings(releaseStuff)

But the command releaseStuff is not recognized, I get:

sbt:sitemap> releaseStuff
[error] Not a valid key: releaseStuff (similar: releasePuff, releaseCough)
[error] releaseStuff
[error]             ^

Am I doing something wrong?

Please note that releaseStuff depends on a plugin so it does not compile if put inside the project folder.

Community
  • 1
  • 1
gurghet
  • 7,591
  • 4
  • 36
  • 63

1 Answers1

1

I don't know what release.sbt is, but you can configure releaseStuff inside of the project folder. You just have to import the applicable plugin packages explicitly.

For example, when I want to use the native-packager for docker, I create a project/docker.scala file with

import sbt._
import Keys._
import com.typesafe.sbt.packager.docker._
import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport._

object Docker {
  lazy val settings = Seq(
    ...
  )
}

and include it from build.sbt

lazy val root = (project in file(".")
  .settings(
    name := "widget",
    Docker.settings
  )
)
Shane Perry
  • 980
  • 7
  • 12
  • 2018 update: ```lazy val root = (project in file(".")) .settings( name := "widget", Docker.settings )``` – randbw Jan 09 '18 at 03:41