-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
74 lines (66 loc) · 2.31 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
lazy val V = _root_.scalafix.sbt.BuildInfo
inThisBuild(
List(
scalaVersion := V.scala213,
crossScalaVersions := List(V.scala213, V.scala212),
organization := "com.earldouglas",
homepage := Some(
url("https://github.com/earldouglas/linear-scala")
),
licenses := List(
("ISC", url("https://opensource.org/licenses/ISC"))
),
developers := List(
Developer(
"earldouglas",
"James Earl Douglas",
url("https://earldouglas.com")
)
),
addCompilerPlugin(scalafixSemanticdb),
scalacOptions ++=
List("-Yrangepos", "-P:semanticdb:synthetics:on"),
versionScheme := Some("semver-spec")
)
)
publish / skip := true
lazy val library = // a standard dependency providing the `Linear` type
project
.settings(
moduleName := "linear-scala",
crossPaths := false // publish without the Scala version postfix in artifact names
)
lazy val rules = // a Scalafix dependency providing the `LinearTypes` rule
project
.settings(
moduleName := "linear-scala-scalafix",
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % V.scalafixVersion
)
lazy val input = // sample input to use for testing; annotated with expected errors
project
.settings(publish / skip := true)
.dependsOn(rules)
.dependsOn(library)
lazy val output = // empty since we're building a linter and not a rewriter, but needed by scalafix-testkit
project
.settings(publish / skip := true)
lazy val tests = // boilerplate to be able to use scalafix-testkit
project
.settings(
publish / skip := true,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % V.scalafixVersion % Test cross CrossVersion.full,
Compile / compile := (Compile / compile)
.dependsOn(input / Compile / compile)
.value,
scalafixTestkitOutputSourceDirectories := (output / Compile / unmanagedSourceDirectories).value,
scalafixTestkitInputSourceDirectories := (input / Compile / unmanagedSourceDirectories).value,
scalafixTestkitInputClasspath := (input / Compile / fullClasspath).value
)
.dependsOn(rules)
.dependsOn(library)
.enablePlugins(ScalafixTestkitPlugin)
lazy val plugin =
project
.in(file("plugin"))
.settings(moduleName := "sbt-linear-scala")