-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
206 lines (175 loc) · 7.84 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
lazy val commonSettings = Seq(
organization := "com.billding",
name := "purelyfunctionalserver",
version := "0.0.1-SNAPSHOT",
// scalaVersion := "2.13.0",
scalaVersion := "2.13.1",
scalacOptions ++= Seq(
"-deprecation",
// "-Xfatal-warnings", // TODO Re-enable once Circe is handled
"-Ywarn-value-discard",
"-Xlint:missing-interpolator"
),
)
lazy val Http4sVersion = "0.21.8"
lazy val DoobieVersion = "0.8.6"
lazy val H2Version = "1.4.197"
lazy val FlywayVersion = "5.2.4"
//libraryDependencies += "io.circe" % "circe-java8_2.13.0-RC1" % "0.12.0-M1"
lazy val CirceVersion = "0.14.0-M1" // Options and java-8 modules are preventing me from further upgrades
lazy val PureConfigVersion = "0.12.1"
lazy val LogbackVersion = "1.2.3"
lazy val ScalaTestVersion = "3.2.0"
lazy val ScalaMockVersion = "4.4.0"
lazy val uTestVersion = "0.7.1"
lazy val zioVersion = "1.0.0-RC17"
lazy val enumeratumVersion = "1.6.1"
lazy val tsecV = "0.2.0-M2"
testFrameworks += new TestFramework("utest.runner.Framework")
lazy val root = project.in(file(".")).
aggregate(foo.js, foo.jvm).
settings(
publish := {},
publishLocal := {},
mainClass in (Compile) := Some("com.billding.Server")
).enablePlugins(JavaServerAppPackaging)
lazy val databaseExploration =
crossProject(JSPlatform).in(file("databaseExploration"))
// project.in(file("databaseExploration")).
// .aggregate(foo.js)
.settings(
scalaVersion := "2.13.1",
scalacOptions ++= Seq(
"-deprecation",
// "-Xfatal-warnings", // TODO Re-enable once Circe is handled
"-Ywarn-value-discard",
"-Xlint:missing-interpolator"
),
publish := {},
publishLocal := {},
libraryDependencies ++= Seq(
"com.raquo" %%% "laminar" % "0.10.3", // Scala.js 1.x only
"com.lihaoyi" %%% "fastparse" % "2.3.0",
"com.lihaoyi" %%% "pprint" % "0.6.0",
"io.circe" %%% "circe-generic" % CirceVersion,
"io.circe" %%% "circe-literal" % CirceVersion,
),
scalaJSUseMainModuleInitializer:=true
)
lazy val foo =
crossProject(JSPlatform, JVMPlatform).in(file("."))
.configs(IntegrationTest)
.configs(Test)
.settings(
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies ++= Seq(
"io.circe" %%% "circe-generic" % CirceVersion,
"io.circe" %%% "circe-literal" % CirceVersion,
"com.beachape" %%% "enumeratum" % enumeratumVersion,
"com.lihaoyi" %%% "utest" % "0.7.5" % "test",
"com.lihaoyi" %%% "pprint" % "0.6.0",
)
)
.jsSettings(
name := "QuadSet Counter",
version := "0.2",
scalaVersion := "2.13.1",
scalaJSUseMainModuleInitializer:=true,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "1.1.0",
"com.raquo" %%% "laminar" % "0.10.2", // Scala.js 1.x only
"com.softwaremill.sttp.client" %%% "core" % "2.2.7",
"com.softwaremill.sttp.client" %%% "circe" % "2.2.7",
// "io.circe" %%% "circe-optics" % CirceVersion,
// "io.circe" %%% "circe-java8" % CirceVersion,
"com.softwaremill.sttp.client" %%% "circe" % "2.0.0-RC5",
"com.pauldijou" %% "jwt-core" % "4.2.0",
"com.pauldijou" %% "jwt-circe" % "4.2.0",
"io.github.cquiroz" %%% "scala-java-time" % "2.0.0",
)
)
.jvmSettings(
mainClass in (Compile) := Some("com.billding.Server"),
commonSettings,
Defaults.itSettings,
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-blaze-server" % Http4sVersion,
"org.http4s" %% "http4s-circe" % Http4sVersion,
"org.http4s" %% "http4s-dsl" % Http4sVersion,
"org.http4s" %% "http4s-blaze-client" % Http4sVersion,
"org.tpolecat" %% "doobie-core" % DoobieVersion,
"org.tpolecat" %% "doobie-h2" % DoobieVersion,
"org.tpolecat" %% "doobie-postgres" % DoobieVersion,
"org.tpolecat" %% "doobie-hikari" % DoobieVersion,
"com.h2database" % "h2" % H2Version,
"org.flywaydb" % "flyway-core" % FlywayVersion,
"io.circe" %% "circe-optics" % "0.13.0" % "it",
// "io.circe" %% "circe-java8" % CirceVersion,
"com.pauldijou" %% "jwt-core" % "4.2.0",
"com.pauldijou" %% "jwt-circe" % "4.2.0",
"com.github.pureconfig" %% "pureconfig" % PureConfigVersion,
"ch.qos.logback" % "logback-classic" % LogbackVersion,
"org.scalatest" %% "scalatest" % ScalaTestVersion % "it,test",
"org.scalamock" %% "scalamock" % ScalaMockVersion % "test",
"com.lihaoyi" %% "utest" % uTestVersion % "test",
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-interop-cats" % "2.0.0.0-RC10",
"dev.zio" %% "zio-macros-core" % "0.5.0",
"javax.servlet" % "javax.servlet-api" % "3.1.0", // No good for Scala
// "com.nulab-inc" %% "scala-oauth2-core" % "1.5.0",
"com.auth0" % "mvc-auth-commons" % "1.1.0",
// Ditch all this tsec stuff if the Heroku/Java examples end up getting me there.
"io.github.jmcardon" %% "tsec-common" % tsecV,
"io.github.jmcardon" %% "tsec-password" % tsecV,
"io.github.jmcardon" %% "tsec-cipher-jca" % tsecV,
"io.github.jmcardon" %% "tsec-cipher-bouncy" % tsecV,
"io.github.jmcardon" %% "tsec-mac" % tsecV,
"io.github.jmcardon" %% "tsec-signatures" % tsecV,
"io.github.jmcardon" %% "tsec-hash-jca" % tsecV,
"io.github.jmcardon" %% "tsec-hash-bouncy" % tsecV,
// "io.github.jmcardon" %% "tsec-libsodium" % tsecV,
"io.github.jmcardon" %% "tsec-jwt-mac" % tsecV,
"io.github.jmcardon" %% "tsec-jwt-sig" % tsecV,
"io.github.jmcardon" %% "tsec-http4s" % tsecV,
"org.scalaz" %% "scalaz-core" % "7.3.2"
)
).enablePlugins(JavaServerAppPackaging)
lazy val cbBuild = taskKey[Unit]("Execute the shell script")
cbBuild := {
(foo.js/Compile/scalafmt).value
(foo.js/Compile/fastOptJS).value
(foo.jvm/Compile/compile).value
(databaseExploration.js/Compile/fastOptJS).value
(foo.jvm/Compile/scalafmt).value
(Compile/scalafmt).value
import scala.sys.process._
(//Process("mkdir ./jvm/src/main/resources/compiledJavaScript") #||
Process("cp ./databaseExploration/js/target/scala-2.13/databaseexploration-fastopt.js ./jvm/src/main/resources/html/PhysicalTherapyTracker/compiledJavaScript/") #&&
Process("cp ./js/target/scala-2.13/quadset-counter-fastopt.js ./jvm/src/main/resources/html/PhysicalTherapyTracker/compiledJavaScript/") #&&
Process("cp ./js/target/scala-2.13/quadset-counter-fastopt.js.map ./jvm/src/main/resources/html/PhysicalTherapyTracker/compiledJavaScript/")
)!
}
lazy val cbPublish = taskKey[Unit]("Execute the shell script")
cbPublish := {
(foo.js/Compile/scalafmt).value
(foo.js/Compile/fullOptJS).value
(foo.jvm/Compile/compile).value
(databaseExploration.js/Compile/fullOptJS).value
(foo.jvm/Compile/scalafmt).value
(Compile/scalafmt).value
import scala.sys.process._
(Process("mkdir ./jvm/src/main/resources/compiledJavaScript") #||
Process("cp ./databaseExploration/js/target/scala-2.13/databaseexploration-opt.js ./jvm/src/main/resources/html/DataStructures") #&&
Process("cp ./js/target/scala-2.13/quadset-counter-opt.js ./jvm/src/main/resources/html/PhysicalTherapyTracker/compiledJavaScript/") #&&
Process("cp sw/target/scala-2.12/sw-opt.js ./jvm/src/main/resources/html/PhysicalTherapyTracker") #&&
Process("cp sw/target/scala-2.12/sw-opt.js.map ./jvm/src/main/resources/html/PhysicalTherapyTracker")
)!
}
lazy val sw = (project in file("sw"))
.enablePlugins(ScalaJSPlugin)
.settings(
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "1.0.0"
)
)