-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
84 lines (77 loc) · 3.49 KB
/
build.sbt
File metadata and controls
84 lines (77 loc) · 3.49 KB
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
import org.scalajs.linker.interface.ModuleSplitStyle
name := "http-path-root"
lazy val root = (project in file("."))
.aggregate(lib.jvm, lib.js, playground)
lazy val commonSettings = Seq(
organization := "wday.httppath",
scalacOptions ++= Seq(
"-explaintypes", // Explain type errors in more detail.
// Additional checks
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:higherKinds", // Allow higher-kinded types
"-language:postfixOps", // Allow postfix ops
// Warning Configuration `scalac -Wconf:help`
"-Wconf:" +
"cat=deprecation:info," + // downgrade deprecation warnings to info messages
// "cat=w-flag-self-implicit:info," + // downgrade self implicit warnings to info messages
// "cat=other-shadowing:info," + // downgrade 'already introduced in an enclosing scope' warnings to info messages
"any:warning-verbose", // print out verbose info for warnings
),
)
lazy val lib = crossProject(JSPlatform, JVMPlatform)
.in(file("lib"))
.settings(
commonSettings,
name := "http-path",
version := "0.0.1",
scalaVersion := "2.13.16",
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-core" % "2.12.0",
"com.lihaoyi" %%% "fastparse" % "3.1.1",
"com.lihaoyi" %%% "ujson" % "4.0.1",
"com.beachape" %%% "enumeratum" % "1.7.4",
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
),
scalacOptions ++= Seq(
"-Xsource:3-cross", // https://docs.scala-lang.org/scala3/guides/migration/tooling-scala2-xsource3.html#enabled-scala-3-syntax
"-explaintypes", // Explain type errors in more detail.
// Additional checks
"-Xlint", // Enable all lints `scalac -Xlint:help`
"-Wdead-code", // Warn when dead code is identified.
"-Wextra-implicit", // Warn when more than one implicit parameter section is defined.
"-Wnumeric-widen", // Warn when numerics are widened.
"-Woctal-literal", // Warn on obsolete octal syntax.
"-Xlint:implicit-recursion", // Warn when an implicit resolves to an enclosing self-definition.
"-Wunused", // Warn if anything is unused `scalac -Wunused:help`
"-Ypatmat-exhaust-depth",
"80", // Allow deeper searching for exhaustive pattern matching
),
)
lazy val playground = project
.in(file("playground"))
.dependsOn(lib.js)
.enablePlugins(ScalaJSPlugin) // Enable the Scala.js plugin in this project
.settings(
commonSettings,
scalaVersion := "3.3.3",
/* Configure Scala.js to emit modules in the optimal way to
* connect to Vite's incremental reload.
* - emit ECMAScript modules
* - emit as many small modules as possible for classes in the "playground" package
* - emit as few (large) modules as possible for all other classes
* (in particular, for the standard library)
*/
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.ESModule)
.withModuleSplitStyle(ModuleSplitStyle.SmallModulesFor(List("playground")))
},
/* Depend on the scalajs-dom library.
* It provides static types for the browser DOM APIs.
*/
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
// keep this dependency aligned with the dependency in lib.js
("com.lihaoyi" %%% "upickle" % "4.0.1").cross(CrossVersion.for3Use2_13),
),
)