I have a libs
module which will contain submodule libaries like maths
, physics
, etc.
I have an app
module which will consume from libs
, but it’s not able to import the package.
.
├── app
│ └── src
│ └── main.scala
├── build.sc
└── libs
└── maths
└── src
└── constants.scala
contents of libs/maths/src/constants.scala
package libs.maths
val Pi = 3.14
contents of app/src/main.scala
package app
import libs.maths.Pi
@main def f() =
printtln(Pi)
I get
import libs.maths.Pi
[102] [error] | ^^^^
[102] [error] | Not found: libs
build.sc
package build
import mill._, scalalib._
object libs extends ScalaModule {
def scalaVersion = "3.7.0"
object maths extends ScalaModule {
def scalaVersion = "3.7.0"
}
}
object app extends ScalaModule {
def scalaVersion = "3.7.0"
def moduleDeps = Seq(libs)
}
Any help is appreciated, thanks.