-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
111 lines (96 loc) · 4.04 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
val dottyVersion = "3.0.0-M2"
val scala213Version = "2.13.4"
ThisBuild / scalaVersion := scala213Version
val zioVersion = "1.0.3"
val Http4sVersion = "0.21.13"
val circeVersion = "0.13.0"
/**
* This doesn't work locally:
* {{{
* sbt:riff> previewSite
* [info] SitePreviewPlugin server started on port 4000. Press any key to exit.
* [error] /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287
* [error] if (cb) cb.apply(this, arguments)
* [error] ^
* [error] TypeError: cb.apply is not a function
* [error] at /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
* [error] at FSReqCallback.oncomplete (fs.js:177:5)
* }}}
*/
// enablePlugins(GitBookPlugin)
enablePlugins(SiteScaladocPlugin)
ghpagesNoJekyll := true
val ScalaTest = "org.scalatest" %% "scalatest" % "3.2.3" % "test"
git.remoteRepo := "[email protected]:{your username}/{your project}.git"
lazy val demo = taskKey[Unit]("Updating the docs").withRank(KeyRanks.APlusTask)
// see https://docs.docker.com/engine/reference/builder
demo := {
import eie.io._
val fullOptPath = (fullOptJS in(riffJS, Compile)).value.data.asPath
val mapFile = fullOptPath.getParent.resolve(s"${fullOptPath.fileName}.map")
streams.value.log(s"Full Opt is: ${fullOptPath.toAbsolutePath}")
println(s"Full Opt is: ${fullOptPath.toAbsolutePath}")
val targetDir = "./docs/demo".asPath
val toCopy = List(fullOptPath, mapFile).map { src =>
src.toFile -> targetDir.resolve(src.fileName).toFile
}
IO.copy(toCopy)
}
lazy val riff = crossProject(JSPlatform, JVMPlatform)
.in(file("."))
.settings(
name := "riff",
version := "0.0.1",
scalaVersion := scala213Version,
crossScalaVersions := Seq(dottyVersion, scala213Version),
scalacOptions ++= {
if (isDotty.value) Seq("-source:3.0-migration")
else Seq("-target:jvm-1.11")
},
javacOptions ++= Seq("-source", "11", "-target", "11"),
libraryDependencies ++= List("io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-generic-extras" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion).map(_.withDottyCompat(scalaVersion.value)),
libraryDependencies ++= List(
"dev.zio" %%% "zio" % zioVersion,
"dev.zio" %%% "zio-test" % zioVersion % "test",
"dev.zio" %%% "zio-test-sbt" % zioVersion % "test"
).map(_.withDottyCompat(scalaVersion.value)))
.jvmSettings(
name := "riffJVM",
libraryDependencies += (ScalaTest).withDottyCompat(scalaVersion.value),
git.remoteRepo := "[email protected]:aaronp/riffd.git"
)
.jsSettings(
name := "riffJS",
// Add JS-specific settings here
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= List(
"com.lihaoyi" %%% "scalatags" % "0.9.2",
"org.scala-js" %%% "scalajs-dom" % "1.1.0").map(_.withDottyCompat(scalaVersion.value))
)
lazy val riffJVM = riff.jvm
lazy val riffJS = riff.js
lazy val rest = project
.in(file("./rest"))
.dependsOn(riffJVM % "compile->compile;test->test")
.settings(
libraryDependencies ++= List("io.circe" %% "circe-generic" % circeVersion,
"io.circe" %% "circe-generic-extras" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion).map(_.withDottyCompat(scalaVersion.value)),
libraryDependencies ++= List(
"com.typesafe" % "config" % "1.4.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
"ch.qos.logback" % "logback-classic" % "1.2.3",
"dev.zio" %% "zio-interop-cats" % "2.2.0.1",
"com.github.aaronp" %% "args4c" % "0.7.0",
"com.github.aaronp" %% "eie" % "1.0.0",
"org.http4s" %% "http4s-blaze-server" % Http4sVersion,
"org.http4s" %% "http4s-blaze-client" % Http4sVersion,
"org.http4s" %% "http4s-circe" % Http4sVersion,
"org.http4s" %% "http4s-core" % Http4sVersion,
"org.http4s" %% "http4s-dsl" % Http4sVersion,
"org.http4s" %% "http4s-prometheus-metrics" % Http4sVersion,
ScalaTest
).map(_.withDottyCompat(scalaVersion.value))
)