-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbuild.sbt
More file actions
109 lines (91 loc) · 3.95 KB
/
Copy pathbuild.sbt
File metadata and controls
109 lines (91 loc) · 3.95 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
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
val lib = Dependencies
Global / onChangedBuildSource := ReloadOnSourceChanges
ThisBuild / scalaVersion := lib.v.scalaVersion
ThisBuild / version := "3.4"
ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / organization := "com.github.max-leuthaeuser"
ThisBuild / organizationName := "SCROLL"
ThisBuild / organizationHomepage := Some(url("https://github.com/max-leuthaeuser/SCROLL"))
ThisBuild / description := "Embedded DSL for role-oriented programming in Scala."
ThisBuild / scmInfo := Some(
ScmInfo(url("https://github.com/max-leuthaeuser/SCROLL"), "scm:git:github.com/max-leuthaeuser/SCROLL.git")
)
ThisBuild / homepage := Some(url("https://github.com/max-leuthaeuser/SCROLL"))
ThisBuild / licenses := List("LGPL 3.0 license" -> url("http://www.opensource.org/licenses/lgpl-3.0.html"))
ThisBuild / developers := List(
Developer(
"max-leuthaeuser",
"Max Leuthaeuser",
"max.leuthaeuser@tu-dresden.de",
url("https://wwwdb.inf.tu-dresden.de/rosi/investigators/doctoral-students/")
)
)
ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / publishMavenStyle := true
ThisBuild / publishTo := {
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
else localStaging.value
}
addCommandAlias("format", ";scalafmtAll;scalafmtSbt")
lazy val noPublishSettings = Seq(publish := {}, publishLocal := {}, publishArtifact := false)
ThisBuild / compile / javacOptions ++= Seq("-Xlint", "--release=11") ++ {
// Scala >= 3.8 requires at least SDK >= 17 for compilation and execution
val javaVersion = sys.props("java.specification.version").toFloat
assert(javaVersion.toInt >= 17, s"this build requires JDK17+ - you're using $javaVersion")
Nil
}
ThisBuild / scalacOptions ++= Seq(
"-Werror",
// Emit warning and location for usages of deprecated APIs:
"-deprecation",
// Emit warning and location for usages of features that should be imported explicitly:
"-feature",
// Allow direct or indirect subclasses of scala.Dynamic:
"-language:dynamics",
// Allow reflective access to members of structural types:
"-language:reflectiveCalls",
// Allow postfix operator notation:
"-language:postfixOps",
// Allow definition of implicit functions called views:
"-language:implicitConversions",
// Enable additional warnings where generated code depends on assumptions:
"-unchecked"
)
lazy val root = (project in file("."))
.settings(name := "SCROLLRoot", noPublishSettings)
.aggregate(core, tests, examples)
lazy val commonSettings = Seq(
libraryDependencies ++= lib.coreDependencies,
dependencyOverrides ++= lib.coreDependenciesOverrides,
Global / cancelable := true
)
lazy val core =
project.settings(commonSettings, Compile / run / mainClass := None, name := "SCROLL", Test / publishArtifact := false)
lazy val examples = project.settings(commonSettings, publish / skip := true).dependsOn(core)
lazy val tests = project
.settings(
commonSettings,
publish / skip := true,
Test / fork := true,
Test / javaOptions ++= Seq("--add-opens", "java.base/java.lang=ALL-UNNAMED"),
Test / testOptions := Seq(
Tests.Argument(
TestFrameworks.ScalaTest,
// F: show full stack traces
// S: show short stack traces
// D: show duration for each test
// I: print "reminders" of failed and canceled tests at the end of the summary,
// eliminating the need to scroll and search to find failed or canceled tests.
// replace with G (or T) to show reminders with full (or short) stack traces
// K: exclude canceled tests from reminder
"-oDI"
)
),
libraryDependencies ++= lib.testDependencies
)
.dependsOn(core, examples)
lazy val benchmark = project
.settings(commonSettings, publish / skip := true, Jmh / run / mainClass := Option("scroll.benchmarks.RunnerApp"))
.enablePlugins(JmhPlugin)
.dependsOn(core)