Let's say we have a SBT bar project with a dependency on some foo artifact:
val bar = Project('bar', file('.')).settings( libraryDependencies += "com.foo" % "foo" % "1.0.0" )
However, in some cases, I want to check the source foo and load the SBT source from my file system instead of the published artifact; that way, I could make local changes to foo and check them out immediately with bar without posting anything.
val foo = Project('foo', file('foo')) val bar = Project('bar', file('.')).dependsOn(foo)
We have a spec.json file in the root folder of bar , which already indicates whether to use foo from the source or as an artifact. Is there a way to configure my assembly to read this file and add dependsOn or libraryDependencies based on the value in spec.json ?
This is easy to do for libraryDependencies :
val bar = Project('bar', file('.')).settings( libraryDependencies ++= if (containsFoo(baseDirectory.value / "spec.json")) { Seq() } else { Seq("com.foo" % "foo" % "1.0.0") } )
However, we cannot find a way to set anything βdynamicβ in dependsOn , for example, reading baseDirectory SettingKey .
source share