-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
93 lines (82 loc) · 3.11 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
import Wart._
enablePlugins(ScalaJSPlugin)
ThisBuild / scalaVersion := "2.13.14"
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / organization := "io.lptk"
ThisBuild / organizationName := "LPTK"
ThisBuild / scalacOptions ++= Seq(
"-deprecation",
"-feature",
"-unchecked",
"-language:higherKinds",
if (insideCI.value) "-Wconf:any:error"
else "-Wconf:any:warning",
)
lazy val root = project.in(file("."))
.aggregate(mlscriptJS, mlscriptJVM, ts2mlsTest, compilerJVM)
.settings(
publish := {},
publishLocal := {},
)
lazy val mlscript = crossProject(JSPlatform, JVMPlatform).in(file("."))
.settings(
name := "mlscript",
scalacOptions ++= Seq(
"-Ywarn-value-discard",
"-Ypatmat-exhaust-depth:160",
),
wartremoverWarnings ++= Warts.allBut(
Recursion, Throw, Nothing, Return, While, IsInstanceOf,
Var, MutableDataStructures, NonUnitStatements,
DefaultArguments, ImplicitParameter, ImplicitConversion,
StringPlusAny, Any, ToString,
JavaSerializable, Serializable, Product, ToString,
LeakingSealed, Overloading,
Option2Iterable, IterableOps, ListAppend, SeqApply,
TripleQuestionMark,
),
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.12" % Test,
libraryDependencies += "com.lihaoyi" %%% "sourcecode" % "0.3.0",
libraryDependencies += "com.lihaoyi" %%% "fastparse" % "2.3.3",
libraryDependencies += "com.lihaoyi" %% "os-lib" % "0.8.0",
//
watchSources += WatchSource(
sourceDirectory.value.getParentFile().getParentFile()/"shared/src/test/diff", "*.fun", NothingFilter),
watchSources += WatchSource(
sourceDirectory.value.getParentFile().getParentFile()/"shared/src/test/diff", "*.mls", NothingFilter),
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oC"),
)
.jsSettings(
scalaJSUseMainModuleInitializer := true,
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.2.0",
)
lazy val mlscriptJVM = mlscript.jvm
lazy val mlscriptJS = mlscript.js
lazy val ts2mls = crossProject(JSPlatform, JVMPlatform).in(file("ts2mls"))
.settings(
name := "ts2mls",
)
.jvmSettings()
.jsSettings(
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.12" % "test"
)
.dependsOn(mlscript % "compile->compile;test->test")
lazy val ts2mlsJS = ts2mls.js
lazy val ts2mlsJVM = ts2mls.jvm
lazy val ts2mlsTest = project.in(file("ts2mls"))
.settings(
Test / test := ((ts2mlsJVM / Test / test) dependsOn (ts2mlsJS / Test / test)).value
)
lazy val compiler = crossProject(JSPlatform, JVMPlatform).in(file("compiler"))
.settings(
name := "mlscript-compiler",
scalaVersion := "3.3.3",
sourceDirectory := baseDirectory.value.getParentFile()/"shared",
watchSources += WatchSource(
baseDirectory.value.getParentFile()/"shared"/"test"/"diff", "*.mls", NothingFilter),
watchSources += WatchSource(
baseDirectory.value.getParentFile()/"shared"/"test"/"diff-ir", "*.mls", NothingFilter),
)
.dependsOn(mlscript % "compile->compile;test->test")
lazy val compilerJVM = compiler.jvm
lazy val compilerJS = compiler.js