forked from WinterTechForum/cb-bus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
73 lines (61 loc) · 2.79 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
//scalaVersion := "2.12.10"
scalaVersion := "2.13.1"
version := "0.2"
enablePlugins(ScalaJSPlugin)
enablePlugins(TzdbPlugin)
resolvers += "jitpack" at "https://jitpack.io"
resolvers += Resolver.url("typesafe", url("http://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns)
resolvers += Resolver.githubPackages("swoogles", "BulmaScala")
val zioVersion = "1.0.0-RC21-2"
libraryDependencies ++= Seq(
"com.billding" %%% "bulmalibrary" % "0.2.19",
"com.billding" %%% "scalajsziolibrary" % "0.0.13",
"com.billding" %%% "brieftime" % "0.0.16",
"com.lihaoyi" %%% "scalatags" % "0.8.6",
"org.scala-js" %%% "scalajs-dom" % "1.0.0",
"dev.zio" %%% "zio" % zioVersion,
"dev.zio" %%% "zio-streams" % zioVersion,
// "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.0.0-RC3_2019a",
// libraryDependencies += "io.github.cquiroz" % "scala-java-time_2.13" % "2.0.0-RC3"
"com.lihaoyi" %%% "pprint" % "0.5.9",
"dev.zio" %%% "zio-test" % zioVersion % "test",
"dev.zio" %%% "zio-test-sbt" % zioVersion % "test",
)
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
// This is an application with a main method
scalaJSUseMainModuleInitializer := true
lazy val cbBuild = taskKey[Unit]("Execute the shell script")
cbBuild := {
(Compile/fastOptJS).value
(Compile/scalafmt).value
import scala.sys.process._
// "ls ./target/scala-2.13" !
(Process("mkdir ./src/main/resources/compiledJavascript") #||
Process("cp ./target/scala-2.13/cb-food-fastopt.js src/main/resources/compiledJavascript/") #&&
Process("cp ./target/scala-2.13/cb-food-fastopt.js.map src/main/resources/compiledJavascript/") #&&
Process("cp sw/target/scala-2.12/sw-opt.js src/main/resources/") #&&
Process("cp sw/target/scala-2.12/sw-opt.js.map src/main/resources/") #&&
Process("cp ./target/scala-2.13/cb-food-jsdeps.js src/main/resources/compiledJavascript/"))!
}
lazy val cbPublish = taskKey[Unit]("Build the files for a real deploment")
cbPublish := {
(Compile/fullOptJS).value
(Compile/scalafmt).value
(sw/Compile/fullOptJS).value
import scala.sys.process._
// "ls ./target/scala-2.13" !
(Process("mkdir ./src/main/resources/compiledJavascript") ###
Process("cp ./target/scala-2.13/cb-food-opt.js src/main/resources/compiledJavascript/") ###
Process("cp ./target/scala-2.13/cb-food-opt.js.map src/main/resources/compiledJavascript/") ###
Process("cp sw/target/scala-2.12/sw-opt.js src/main/resources/") ###
Process("cp sw/target/scala-2.12/sw-opt.js.map src/main/resources/"))!
}
zonesFilter := {(z: String) => z == "America/Denver" || z == "America/Mountain"}
lazy val sw = (project in file("sw"))
.enablePlugins(ScalaJSPlugin)
.settings(
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "1.0.0"
)
)