mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 13:36:59 +01:00
49 lines
1.2 KiB
Text
49 lines
1.2 KiB
Text
//| mvnDeps : ["com.raquo::domtypes:18.1.0"]
|
|
|
|
package build
|
|
|
|
import mill.*, scalalib.*, javascriptlib.*
|
|
import mill.api.Task.Simple
|
|
|
|
trait ScalaCommon extends ScalaModule:
|
|
def scalaVersion = "3.7.2"
|
|
def scalacOptions = Seq(
|
|
"-Wunused:all",
|
|
"-preview",
|
|
"-feature",
|
|
"-language:implicitConversions",
|
|
"-Wvalue-discard"
|
|
)
|
|
|
|
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
|
|
def mvnDeps = Seq(mvn"dev.zio::zio-json:0.7.44")
|
|
|
|
def generatedSources = Task {
|
|
new DomDefsGenerator((Task.dest / "core/src/scalive").toString).generate()
|
|
super.generatedSources() ++ Seq(PathRef(Task.dest))
|
|
}
|
|
|
|
def jsBundle = Task {
|
|
val bundleDest = Task.dest / "static" / "scalive.js"
|
|
os.copy(
|
|
from = js.bundle().path,
|
|
to = bundleDest
|
|
)
|
|
PathRef(Task.dest)
|
|
}
|
|
|
|
def resources = Task {
|
|
super.resources() ++ Seq(jsBundle())
|
|
}
|
|
|
|
object test extends ScalaTests with scalalib.TestModule.Utest:
|
|
def utestVersion = "0.9.0"
|
|
|
|
object zio extends ScalaCommon:
|
|
def mvnDeps = Seq(mvn"dev.zio::zio-http:3.4.0")
|
|
override def moduleDeps = Seq(core)
|