-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathbuild.sbt
50 lines (45 loc) · 1.99 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
lazy val scalaTestVersion = "3.2.19"
ThisBuild / crossScalaVersions := Seq("3.3.4", "2.13.15", "2.12.20", "2.11.12")
ThisBuild / scalaVersion := crossScalaVersions.value.head
// We use <epoch>.<major>.<minor> like 99% of Scala libraries.
// Versions are binary compatible within x.y.* but not within x.*.*
ThisBuild / versionScheme := Some("pvp")
ThisBuild / versionPolicyIntention := Compatibility.None // 3.0.0
lazy val swing = project.in(file("."))
.settings(ScalaModulePlugin.scalaModuleSettings)
.enablePlugins(SbtOsgi)
.settings(ScalaModulePlugin.scalaModuleOsgiSettings)
.settings(
name := "scala-swing",
scalaModuleAutomaticModuleName := Some("scala.swing"),
OsgiKeys.exportPackage := Seq(s"scala.swing.*;version=${version.value}"),
// scalaModuleMimaPreviousVersion := Some("2.1.0"), TODO re-enable after we have a 3.0 release
// set the prompt (for this build) to include the project id.
ThisBuild / shellPrompt := { state => Project.extract(state).currentRef.project + "> " },
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest-flatspec" % scalaTestVersion % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % scalaTestVersion % Test,
),
// Adds a `src/main/scala-2.13+` source directory for Scala 2.13 and newer
// and a `src/main/scala-2.13-` source directory for Scala version older than 2.13
Compile / unmanagedSourceDirectories += {
val sourceDir = (Compile / sourceDirectory).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 => sourceDir / "scala-2.13+"
case Some((3, _)) => sourceDir / "scala-2.13+" // Dotty
case _ => sourceDir / "scala-2.13-"
}
},
)
lazy val examples = project.in(file("examples"))
.dependsOn(swing)
.settings(
run / fork := true,
fork := true,
)
lazy val uitest = project.in(file("uitest"))
.dependsOn(swing)
.settings(
run / fork := true,
fork := true,
)