-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
106 lines (97 loc) · 3.29 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
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
lazy val V = _root_.scalafix.sbt.BuildInfo
lazy val rulesCrossVersions = Seq(V.scala213, V.scala212, V.scala211)
lazy val scala3Version = "3.2.1"
ThisBuild / homepage := Some(url("https://github.com/tersesystems/disable-case-class-to-string"))
ThisBuild / startYear := Some(2022)
ThisBuild / licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/tersesystems/disable-case-class-to-string"),
"scm:git@github.com:tersesystems/disable-case-class-to-string.git"
)
)
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
def scalacOptionsVersion(scalaVersion: String): Seq[String] = {
(CrossVersion.partialVersion(scalaVersion) match {
case Some((3, n)) =>
Seq.empty
case Some((2, n)) if n >= 13 =>
Seq("-P:semanticdb:synthetics:on")
case Some((2, n)) if n == 12 =>
Seq("-P:semanticdb:synthetics:on")
case Some((2, n)) if n == 11 =>
Seq("-P:semanticdb:synthetics:on")
})
}
lazy val `disable-case-class-to-string` = (project in file("."))
.aggregate(
rules.projectRefs ++
input.projectRefs ++
output.projectRefs ++
tests.projectRefs: _*
)
.settings(
publish / skip := true
)
lazy val rules = projectMatrix
.settings(
moduleName := "scalafix",
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % V.scalafixVersion,
scalacOptions := scalacOptionsVersion(scalaVersion.value)
)
.defaultAxes(VirtualAxis.jvm)
.jvmPlatform(rulesCrossVersions)
lazy val input = projectMatrix
.settings(
publish / skip := true,
scalacOptions := scalacOptionsVersion(scalaVersion.value)
)
.defaultAxes(VirtualAxis.jvm)
.jvmPlatform(scalaVersions = rulesCrossVersions :+ scala3Version)
lazy val output = projectMatrix
.settings(
publish / skip := true,
scalacOptions := scalacOptionsVersion(scalaVersion.value)
)
.defaultAxes(VirtualAxis.jvm)
.jvmPlatform(scalaVersions = rulesCrossVersions :+ scala3Version)
lazy val testsAggregate = Project("tests", file("target/testsAggregate"))
.aggregate(tests.projectRefs: _*)
.settings(
publish / skip := true
)
lazy val tests = projectMatrix
.settings(
publish / skip := true,
scalafixTestkitOutputSourceDirectories :=
TargetAxis
.resolve(output, Compile / unmanagedSourceDirectories)
.value,
scalafixTestkitInputSourceDirectories :=
TargetAxis
.resolve(input, Compile / unmanagedSourceDirectories)
.value,
scalafixTestkitInputClasspath :=
TargetAxis.resolve(input, Compile / fullClasspath).value,
scalafixTestkitInputScalacOptions :=
TargetAxis.resolve(input, Compile / scalacOptions).value,
scalafixTestkitInputScalaVersion :=
TargetAxis.resolve(input, Compile / scalaVersion).value,
scalacOptions := scalacOptionsVersion(scalaVersion.value)
)
.defaultAxes(
rulesCrossVersions.map(VirtualAxis.scalaABIVersion) :+ VirtualAxis.jvm: _*
)
.jvmPlatform(
scalaVersions = Seq(V.scala213),
axisValues = Seq(TargetAxis(V.scala213)),
settings = Seq()
)
.jvmPlatform(
scalaVersions = Seq(V.scala212),
axisValues = Seq(TargetAxis(V.scala212)),
settings = Seq()
)
.dependsOn(rules)
.enablePlugins(ScalafixTestkitPlugin)