以下build.sbt文件有效,但它定义了所有子项目的依赖关系:
name := "myproject"
version := "1.0"
scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
"org.scalafx" %% "scalafx" % "8.0.60-R9"
)
lazy val aLib = (project in file("lib/a"))
lazy val bLib = (project in file("lib/b"))
.dependsOn(aLib)
.dependsOn(cLib)
lazy val cLib = (project in file("lib/c"))
.dependsOn(aLib)
lazy val myApp = (project in file("myapp"))
.dependsOn(aLib)
.dependsOn(bLib)
.dependsOn(cLib)
.aggregate(aLib, bLib, cLib)
由于每个子项目(目录lib / a,lib / b,lib / c,myapp)都有自己的build.sbt文件,我想使用这些构建文件来定义每个项目的各个依赖项。
我尝试将dependsOn
/ aggregate
语句移至子项目'构建文件,但我不能让它以这种方式工作。推荐的方式是什么?