-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
124 lines (116 loc) · 3.44 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
ThisBuild / versionScheme := Some("early-semver")
// For all Sonatype accounts created on or after February 2021
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / scalaVersion := "3.3.0"
inThisBuild(
List(
organization := "net.wiringbits",
name := "wiringbits-webapp-utils",
homepage := Some(url("https://github.com/wiringbits/wiringbits-webapp-utils")),
licenses := List("MIT" -> url("https://www.opensource.org/licenses/mit-license.html")),
developers := List(
Developer(
"AlexITC",
"Alexis Hernandez",
url("https://wiringbits.net")
)
)
)
)
resolvers += Resolver.sonatypeRepo("releases")
val playJson = "2.10.0-RC5"
val stMaterialUi = "5.11.16"
// Used only by the lib projects
lazy val baseLibSettings: Project => Project = _.settings(
scalacOptions ++= {
Seq(
"-encoding",
"UTF-8",
"-feature",
"-language:implicitConversions",
"-unchecked",
"-source:3.0-migration"
)
},
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.2.15" % Test
)
)
// Used only by the lib projects
lazy val baseWebSettings: Project => Project =
_.enablePlugins(ScalaJSPlugin)
.settings(
scalacOptions ++= {
Seq(
"-encoding",
"UTF-8",
"-feature",
"-language:implicitConversions",
"-unchecked",
"-source:3.0-migration"
)
},
libraryDependencies ++= Seq(
"io.github.cquiroz" %%% "scala-java-time" % "2.3.0",
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.1.1",
"com.olvind.st-material-ui" %%% "st-material-ui-icons-slinky" % stMaterialUi
)
)
/** The common stuff for the server/client modules
*/
lazy val webappCommon = (crossProject(JSPlatform, JVMPlatform) in file("webapp-common"))
.configure(baseLibSettings)
.settings(
name := "webapp-common"
)
.jsConfigure(_.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin))
.jvmSettings(
libraryDependencies ++= Seq(
// TODO: This shouldn't depend in play-json but I'm leaving it for simplicity
"com.typesafe.play" %% "play-json" % playJson
)
)
.jsSettings(
stUseScalaJsDom := true,
Test / fork := false, // sjs needs this to run tests
Compile / stMinimize := Selection.All,
libraryDependencies ++= Seq(
// TODO: This shouldn't depend in play-json but I'm leaving it for simplicity
"com.typesafe.play" %%% "play-json" % playJson
)
)
/** Utils specific to slinky
*/
lazy val slinkyUtils = (project in file("slinky-utils"))
.configure(baseLibSettings, baseWebSettings)
.configure(_.enablePlugins(ScalaJSPlugin, ScalaJSBundlerPlugin))
.dependsOn(webappCommon.js)
.settings(
name := "slinky-utils",
Test / fork := false, // sjs needs this to run tests
useYarn := true,
Compile / npmDependencies ++= Seq(
"react" -> "18.2.0",
"react-dom" -> "18.2.0",
"@mui/material" -> "5.11.16",
"@mui/icons-material" -> "5.11.16",
"@mui/joy" -> "5.0.0-alpha.74",
"@emotion/react" -> "11.10.6",
"@emotion/styled" -> "11.10.6",
"react-router" -> "5.1.2",
"react-router-dom" -> "5.1.2"
)
)
lazy val root = (project in file("."))
.aggregate(
webappCommon.jvm,
webappCommon.js,
slinkyUtils
)
.settings(
name := "wiringbits-webapp-utils",
publish := {},
publishLocal := {},
publish / skip := true
)