Given a simple project structure like this:
+ lib1/
| + build.sbt
+ build.sbt
where
./lib1/build.sbt
is:
name := "Library 1"
./build.sbt
is:
lazy val lib1 =
project.in(file("lib1")).settings(name := "Blah blah", version := "1.2.3")
What seems to happen is that settings in ./lib1/build.sbt
override settings for the same project specified in build.sbt
because lib1/name
resolves to "Library 1" and not "Blah blah" but lib1/version
resolves to "1.2.3" from the sbt console.
Is there any way I could make it the other way around, so that I can override some settings specified in ./lib1/build.sbt
in ./build.sbt
instead?
Edit:
Similarly, if ./lib1/build.sbt
is just a plain list of settings as above I can do this in the main build.sbt
:
lazy val lib1 = project.in(file("lib1"))
lazy val lib2 = project.in(file("lib2")).dependsOn(lib1)
and I can see that it works by checking show lib2/internalDependencyClasspath
in console, however if ./lib1/build.sbt
is instead
lazy val lib1 = project.in(file(".")).settings(name := "Library 1")
I can no longer use dependsOn
in the main build.sbt
Related:
SBT: Override setting in multi-build dependsOn/aggregate project