对于有subproject 的scala工程
#build.sbt
lazy val core = (project in file("core"))
lazy val sim = (project in file("sim"))
lazy val lib = (project in file("lib"))
目录层次如下
├── core
│ └── src
│ ├── main
│ └── test
├── lib
│ └── src
│ ├── main
│ └── test
└── sim
└── src
├── main
│ └── scala
│ └── spinal
│ └── sim
│ └── Gen.scala
└── test
└── scala
└── spinal
└── sim
└── Test.scala
单project运行某个Main函数
sbt "runMain core.Gen"
subproject的运行某个Main函数
sbt "sim/runMain spinal.sim.Gen"
subproject下test目录中的某个Main函数
sbt "sim/test:runMain spinal.sim.Test "
运行某个subproject 下的某个test
sbt "sim/testOnly spinal.sim.someTest"
运行某个subproject 下的的所有test
sbt "sim/testOnly "
运行所有test
sbt testOnly
subproject的运行某个Main函数
mill sim.runMain svm.sim.generator
// copy foo.jar to foo/lib/
object foo extends SpinalModule {
override def unmanagedClasspath = T {
if (!os.exists(millSourcePath / "lib")) Agg()
else Agg.from(os.list(millSourcePath / "lib").map(PathRef(_)))
}
}
object mylib extends SpinalModule{
override def moduleDeps = Seq(foo)
}