2025-08-16 04:49:13 +02:00
|
|
|
//| mvnDeps : ["com.raquo::domtypes:18.1.0"]
|
|
|
|
|
|
2025-08-03 19:51:02 +02:00
|
|
|
package build
|
2025-08-16 04:49:13 +02:00
|
|
|
|
2025-08-21 04:14:31 +02:00
|
|
|
import mill.*, scalalib.*, javascriptlib.*
|
2025-08-16 04:49:13 +02:00
|
|
|
import mill.api.Task.Simple
|
2025-08-03 19:51:02 +02:00
|
|
|
|
2025-08-21 04:14:31 +02:00
|
|
|
trait ScalaCommon extends ScalaModule:
|
2025-08-16 04:49:13 +02:00
|
|
|
def scalaVersion = "3.7.2"
|
2025-08-19 21:23:29 +02:00
|
|
|
def scalacOptions = Seq(
|
|
|
|
|
"-Wunused:all",
|
|
|
|
|
"-preview",
|
|
|
|
|
"-feature",
|
|
|
|
|
"-language:implicitConversions",
|
|
|
|
|
"-Wvalue-discard"
|
|
|
|
|
)
|
2025-08-15 22:51:27 +02:00
|
|
|
|
2025-08-21 04:14:31 +02:00
|
|
|
object js extends TypeScriptModule:
|
|
|
|
|
def npmDeps = Seq("morphdom@2.7.7")
|
|
|
|
|
def mainFileName = "index.ts"
|
|
|
|
|
|
|
|
|
|
object core extends ScalaCommon:
|
|
|
|
|
// Replace with ujson, core shouldn't depend on ZIO
|
2025-08-05 02:23:59 +02:00
|
|
|
def mvnDeps = Seq(mvn"dev.zio::zio-json:0.7.44")
|
2025-08-09 01:31:43 +02:00
|
|
|
|
2025-08-16 04:49:13 +02:00
|
|
|
def generatedSources = Task {
|
|
|
|
|
new DomDefsGenerator((Task.dest / "core/src/scalive").toString).generate()
|
|
|
|
|
super.generatedSources() ++ Seq(PathRef(Task.dest))
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-21 04:14:31 +02:00
|
|
|
def jsBundle = Task {
|
|
|
|
|
os.copy(
|
|
|
|
|
from = js.bundle().path,
|
2025-08-21 14:10:47 +02:00
|
|
|
to = Task.dest / "static" / "scalive.js",
|
|
|
|
|
createFolders = true
|
2025-08-21 04:14:31 +02:00
|
|
|
)
|
|
|
|
|
PathRef(Task.dest)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def resources = Task {
|
|
|
|
|
super.resources() ++ Seq(jsBundle())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object test extends ScalaTests with scalalib.TestModule.Utest:
|
2025-08-09 01:31:43 +02:00
|
|
|
def utestVersion = "0.9.0"
|
|
|
|
|
|
2025-08-21 04:14:31 +02:00
|
|
|
object zio extends ScalaCommon:
|
2025-08-21 14:10:47 +02:00
|
|
|
def mvnDeps = Seq(mvn"dev.zio::zio-http:3.4.0")
|
|
|
|
|
def moduleDeps = Seq(core)
|
|
|
|
|
|
|
|
|
|
object example extends ScalaCommon:
|
|
|
|
|
def moduleDeps = Seq(zio)
|