mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 05:26:59 +01:00
56 lines
1.4 KiB
Text
56 lines
1.4 KiB
Text
//| mvnDeps : ["com.raquo::domtypes:18.1.0"]
|
|
|
|
package build
|
|
|
|
import mill.*, scalalib.*, javascriptlib.*
|
|
import mill.api.Task.Simple
|
|
import java.net.URI
|
|
import java.nio.file.*
|
|
import java.nio.file.attribute.BasicFileAttributes
|
|
import java.util
|
|
|
|
trait ScalaCommon extends ScalaModule:
|
|
def scalaVersion = "3.7.2"
|
|
def scalacOptions = Seq(
|
|
"-Wunused:all",
|
|
"-preview",
|
|
"-feature",
|
|
"-language:implicitConversions",
|
|
"-Wvalue-discard"
|
|
)
|
|
|
|
object core extends ScalaCommon:
|
|
// TODO 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))
|
|
}
|
|
|
|
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")
|
|
def moduleDeps = Seq(core)
|
|
|
|
object example extends ScalaCommon:
|
|
def moduleDeps = Seq(zio)
|
|
|
|
def scaliveBundle = Task {
|
|
os.copy(
|
|
from = example.js.bundle().path,
|
|
to = Task.dest / "public" / "app.js",
|
|
createFolders = true
|
|
)
|
|
PathRef(Task.dest)
|
|
}
|
|
|
|
def resources = Task {
|
|
super.resources() ++ Seq(scaliveBundle())
|
|
}
|
|
|
|
object js extends TypeScriptModule:
|
|
def mainFileName = "app.js"
|
|
def npmDeps = Seq("phoenix@1.7.21", "phoenix_live_view@1.1.8")
|