-
Notifications
You must be signed in to change notification settings - Fork 55
/
build.sbt
59 lines (55 loc) · 1.95 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
val sjsonnetVersion = "0.4.13"
scalaVersion in Global := "2.13.12"
cancelable in Global := true
lazy val main = (project in file("sjsonnet"))
.settings(
Compile / scalacOptions ++= Seq("-opt:l:inline", "-opt-inline-from:sjsonnet.*,sjsonnet.**"),
Test / fork := true,
Test / baseDirectory := (ThisBuild / baseDirectory).value,
libraryDependencies ++= Seq(
"com.lihaoyi" %% "fastparse" % "2.3.3",
"com.lihaoyi" %% "pprint" % "0.6.6",
"com.lihaoyi" %% "ujson" % "1.3.15",
"com.lihaoyi" %% "scalatags" % "0.9.4",
"com.lihaoyi" %% "os-lib" % "0.7.8",
"com.lihaoyi" %% "mainargs" % "0.2.5",
"org.lz4" % "lz4-java" % "1.8.0",
"org.json" % "json" % "20240303",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0",
"org.tukaani" % "xz" % "1.8",
"org.yaml" % "snakeyaml" % "1.33",
),
libraryDependencies ++= Seq(
"com.lihaoyi" %% "utest" % "0.8.2",
).map(_ % "test"),
testFrameworks += new TestFramework("utest.runner.Framework"),
(Compile / unmanagedSourceDirectories) := Seq(
baseDirectory.value / "src",
baseDirectory.value / "src-jvm",
baseDirectory.value / "src-jvm-native",
),
(Test / unmanagedSourceDirectories) := Seq(
baseDirectory.value / "test/src",
baseDirectory.value / "test/src-jvm",
baseDirectory.value / "test/src-jvm-native",
),
(Test / unmanagedResourceDirectories) := Seq(
baseDirectory.value / "test/resources",
),
(Compile / sourceGenerators) += Def.task {
val file = (Compile / sourceManaged).value / "jsonnet" / "Version.scala"
IO.write(file,
s"""package sjsonnet
|object Version{
| val version = "${sjsonnetVersion}"
|}
|""".stripMargin)
Seq(file)
}.taskValue
)
lazy val bench = (project in file("bench"))
.dependsOn(main % "compile->test")
.enablePlugins(JmhPlugin)
.settings(
run / fork := true,
)