-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
64 lines (55 loc) · 1.96 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
Global / onChangedBuildSource := ReloadOnSourceChanges
val scala3 = "3.3.1"
val scalaVersions = Seq("2.13.12", scala3)
ThisBuild / crossScalaVersions := scalaVersions
// GitHub Actions config
val javaVersions = Seq(8, 11, 17, 21).map(v => JavaSpec.temurin(v.toString))
ThisBuild / githubWorkflowJavaVersions := javaVersions
ThisBuild / githubWorkflowArtifactUpload := false
ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false)
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowPublishTargetBranches := Seq()
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("tests/compile"), name = Some("test")),
)
def foldScalaV[A](scalaVersion: String)(_2: => A, _3: => A): A =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, _)) => _2
case Some((3, _)) => _3
}
val baseSettings = Seq(
crossScalaVersions := scalaVersions,
scalaVersion := scala3,
organization := "bondlink",
version := "1.1.1",
gitPublishDir := file("/src/maven-repo"),
)
lazy val nowarnPlugin = project.in(file("."))
.settings(baseSettings)
.settings(
name := "nowarn-plugin",
libraryDependencies += foldScalaV(scalaVersion.value)(
"org.scala-lang" % "scala-compiler",
"org.scala-lang" %% "scala3-compiler",
) % scalaVersion.value % "provided",
)
lazy val tests = project.in(file("tests"))
.settings(baseSettings)
.settings(
publish := {},
publishLocal := {},
gitRelease := {},
scalacOptions ++= {
val jar = (nowarnPlugin / Compile / Keys.`package`).value
Seq(
s"-Xplugin:${jar.getAbsolutePath}",
s"-Jdummy${name.value}=${jar.lastModified}",
// TODO - enable this once https://github.com/lampepfl/dotty/issues/18341 is resolved
// "-Wunused:nowarn",
"-P:nowarn:unused:msg=(unused|never used)",
"-P:nowarn:bl.unused:msg=(unused|never used)",
"-P:nowarn:undeprecated:cat=deprecation"
),
}
)
.aggregate(nowarnPlugin)