-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
63 lines (58 loc) · 2.6 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
lazy val basicSettings = Seq(
organization := "net.marek",
organizationName := "Marek",
organizationHomepage := Some(url("http://marek.net")),
startYear := Some(2023),
name := "tyre-scala",
description := "Typed regex parser",
homepage := Some(url("https://github.com/kasiaMarek/tyre-scala")),
scalaVersion := "3.3.4"
)
addCommandAlias("validate", "; compile; Test/compile; scalafmtCheck; test")
addCommandAlias("evaluate", "; test; project benchmark; Jmh/run -i 3 -wi 1 -f1 -t1; project root")
lazy val root = (project in file("."))
.settings(basicSettings: _*)
.settings(
licenses += ("Apache-2.0", new URI("https://www.apache.org/licenses/LICENSE-2.0.txt").toURL),
versionScheme := Some("semver-spec"),
libraryDependencies ++= Seq(
"org.scala-lang.modules" % "scala-parser-combinators_3" % "2.4.0",
"org.scalatest" %% "scalatest" % "3.2.19" % Test
),
Test / fork := true,
javaOptions += "-Dfile.encoding=UTF-8",
scalacOptions ++= scalacSettings,
Compile / console / scalacOptions --= Seq("-Xfatal-warnings"),
semanticdbEnabled := true
)
.settings(publishSettings: _*)
lazy val benchmark = (project in file("benchmark"))
.settings(basicSettings: _*)
.settings(
name := "tyre-benchmark"
)
.enablePlugins(JmhPlugin)
.dependsOn(root)
lazy val scalacSettings = Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-explain", // Explain errors in more detail.
"-explain-types", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:higherKinds,implicitConversions", // Enable language features.
"-new-syntax", // Require Scala 3 syntax
"-pagewidth:120", // Set output page width.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Wvalue-discard", // Warn about unused expression results.
"-Wunused:all", // Warn about unused code
"-Wconf:cat=deprecation:w,unused:w,any:e", // Fail the compilation if there are any warnings except deprecation.
"-Xtarget:17", // Set target JVM version.
"-Xverify-signatures", // Verify generic signatures in generated bytecode.
"-Ykind-projector:underscores" // require ? as type parametr wildcards and _ as placeholder
)
lazy val publishSettings = Seq(
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
developers := List(
Developer("kasiaMarek", "Katarzyna Marek", "[email protected]", url("https://github.com/kasiaMarek")),
Developer("susuro", "Robert Marek", "[email protected]", url("https://github.com/susuro"))
)
)