aboutsummaryrefslogtreecommitdiff
path: root/build.sc
blob: 7b2b875a48c7ed70eff9da0848b660fc216df076 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import mill._, scalalib._, scalajslib._, scalanativelib._, scalafmt._

trait Shared extends ScalaModule with ScalafmtModule{

  def sharedSources = T.sources(build.millSourcePath / "shared")

  def sources = T.sources(
    super.sources() ++ sharedSources()
  )

  def ivyDeps = Agg(
    ivy"xyz.driver::spray-json-derivation::0.4.3",
    ivy"com.lihaoyi::scalatags::0.6.7"
  )

}

object server extends ScalaModule with Shared {
  def scalaVersion = "2.12.9"

  def ivyDeps = T {
    super.ivyDeps() ++ Agg(
      ivy"com.typesafe.akka::akka-stream:2.5.11",
      ivy"com.typesafe.akka::akka-http:10.1.0",
      ivy"com.typesafe.akka::akka-http-spray-json:10.1.0",
      ivy"com.typesafe.slick::slick:3.2.3",
      ivy"org.slf4j:slf4j-nop:1.6.4",
      ivy"org.xerial:sqlite-jdbc:3.21.0.1"
    )
  }

  // This includes the resulting javascript file so that it can be served
  // as a classpath resource and is packaged in the final jar.
  def localClasspath = T{
    super.localClasspath() :+ PathRef(ui.fastOpt().path / os.up)
  }

}

object ui extends ScalaJSModule with Shared {
  def scalaVersion = "2.12.10"
  def scalaJSVersion = "0.6.29"

  def ivyDeps = T {
    super.ivyDeps() ++ Agg(
      ivy"org.scala-js::scalajs-dom::0.9.5",
      ivy"org.scala-js::scalajs-java-time::0.2.5"
    )
  }

}

object client extends ScalaNativeModule with Shared {
  import scalanativelib.api.ReleaseMode
  
  def scalaVersion = "2.11.12"
  def scalaNativeVersion = "0.3.8"
  
  def releaseMode = ReleaseMode.Debug

  def ivyDeps = T {
    super.ivyDeps() ++ Agg(
      ivy"io.crashbox::commando::0.1.2"
    )
  }
}

def dist = T {
  server.assembly()
  client.nativeLink()
}