These are chat archives for sbt/sbt
A relaxed chat room about sbt (That interactive build tool). For getting help on sbt, we encourage people to document it on Stackoverflow or subscribing to Lightbend subscription.
compilerReporterbecome a private key? is there a way to set it now?
val creporter = SettingKey[CompilerReporter]("compilerReporter", "")
I have a multi-project. In my root
build.sbt file I have some common settings and two subproject definitions:
lazy val commonSettings = Seq(/* … */) lazy val core = (project in file(“core”)).settings(commonSettings: _*) lazy val web = (project in file(“web”)).settings(commonSettings: _*). dependsOn(core % “compile->compile;test->test”) lazy val root = (project in file(“.”)).settings(commonSettings: _*). aggregate(core, web)
web/build.sbt I define
name and append to
libraryDependencies. Both subprojects have the same dependency and I’d like to extract that dependency’s version into a variable somehow. Something like this works locally (within the same
val libVersion = “1.2.3” libraryDependencies += “org” %% “lib” % libVersion
This doesn’t work when
libVersion is defined in
build.sbt and referenced in
core/build.sbt. I also tried to define a
settingsKey in the root
build.sbt and access
libVersion.value in the subproject
build.sbt but that failed as well.
Why is this happening? I’d like to understand how sbt separates the scope of the
build.sbt files between subprojects. Maybe there’s something about scopes I’m not understanding?