-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
61 lines (52 loc) · 1.96 KB
/
build.sbt
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
// Shadow sbt-scalajs' crossProject and CrossType until Scala.js 1.0.0 is released
import sbtcrossproject.{crossProject, CrossType}
val Pine = "0.1.1"
val Trail = "0.1.1"
val Scala = "2.12.4-bin-typelevel-4"
val Circe = "0.9.1"
val Http4s = "0.18.1"
val Scribe = "2.2.0"
val Paradise = "2.1.1"
val jsPath = file("assets") / "js"
lazy val example = crossProject(JSPlatform, JVMPlatform)
.withoutSuffixFor(JVMPlatform)
.in(file("."))
.settings(
name := "pine-example",
version := "0.1.0",
scalaVersion := Scala,
scalaOrganization := "org.typelevel",
scalacOptions += "-Yliteral-types",
addCompilerPlugin(
"org.scalamacros" % "paradise" % Paradise cross CrossVersion.patch
),
libraryDependencies ++= Vector(
"tech.sparse" %%% "pine" % Pine,
"tech.sparse" %%% "trail" % Trail,
"io.circe" %%% "circe-core" % Circe,
"io.circe" %%% "circe-generic" % Circe,
"io.circe" %%% "circe-parser" % Circe
)
)
.jvmSettings(
libraryDependencies ++= Vector(
"org.http4s" %% "http4s-dsl" % Http4s,
"org.http4s" %% "http4s-blaze-client" % Http4s,
"org.http4s" %% "http4s-blaze-server" % Http4s,
"com.outr" %% "scribe-slf4j" % Scribe
),
reStart / mainClass := Some("example.Server"),
reStart / baseDirectory := file(".")
)
.jsSettings(
// From https://github.com/scala-js/scala-js/pull/2954
libraryDependencies := libraryDependencies.value.filterNot(_.name == "scalajs-compiler"),
addCompilerPlugin("org.scala-js" % "scalajs-compiler" % scalaJSVersion cross CrossVersion.patch),
scalaJSUseMainModuleInitializer := true,
Compile / fastOptJS / artifactPath := jsPath / "application.js",
Compile / fullOptJS / artifactPath := jsPath / "application.js"
)
lazy val js = example.js
lazy val jvm = example.jvm.settings(
reStart := reStart.dependsOn(js / Compile / fastOptJS).evaluated
)