-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathbuild.sbt
130 lines (121 loc) · 3.42 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import sbtcrossproject.CrossProject
import sbtcrossproject.CrossType
val scalatestVersion = "3.2.9"
val scalametaVersion = "4.4.18"
val defaultScala213 = "2.13.6"
val bin211 = Seq("2.11.12")
val bin212 = Seq("2.12.13", "2.12.12", "2.12.11", "2.12.10", "2.12.9", "2.12.8")
val bin213 =
Seq(
defaultScala213,
"2.13.5",
"2.13.4",
"2.13.3",
"2.13.2",
"2.13.1",
"2.13.0"
)
inThisBuild(
List(
organization := "org.scoverage",
homepage := Some(url("http://scoverage.org/")),
developers := List(
Developer(
"sksamuel",
"Stephen Samuel",
url("https://github.com/sksamuel")
),
Developer(
"gslowikowski",
"Grzegorz Slowikowski",
url("https://github.com/gslowikowski")
)
),
licenses := Seq(
"Apache-2.0" -> url("http://www.apache.org/license/LICENSE-2.0")
),
scalaVersion := defaultScala213,
versionScheme := Some("early-semver"),
Test / fork := false,
Test / publishArtifact := false,
Test / parallelExecution := false,
Global / concurrentRestrictions += Tags.limit(Tags.Test, 1),
scalacOptions := Seq(
"-unchecked",
"-deprecation",
"-feature",
"-encoding",
"utf8"
),
scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.5.0",
semanticdbEnabled := true,
semanticdbVersion := scalametaVersion,
scalafixScalaBinaryVersion := scalaBinaryVersion.value
)
)
lazy val sharedSettings = List(
scalacOptions := {
if (scalaVersion.value == defaultScala213) {
scalacOptions.value :+ "-Wunused:imports"
} else {
scalacOptions.value
}
},
crossScalaVersions := bin211 ++ bin212 ++ bin213
)
lazy val root = Project("scalac-scoverage", file("."))
.settings(
name := "scalac-scoverage",
publishArtifact := false,
publishLocal := {}
)
.aggregate(plugin, runtime.jvm, runtime.js)
lazy val runtime = CrossProject(
"scalac-scoverage-runtime",
file("scalac-scoverage-runtime")
)(JVMPlatform, JSPlatform)
.crossType(CrossType.Full)
.withoutSuffixFor(JVMPlatform)
.settings(
name := "scalac-scoverage-runtime",
crossTarget := target.value / s"scala-${scalaVersion.value}",
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % scalatestVersion % Test
),
sharedSettings
)
.jvmSettings(
Test / fork := true
)
.jsSettings(
scalaJSStage := FastOptStage
)
lazy val `scalac-scoverage-runtimeJVM` = runtime.jvm
lazy val `scalac-scoverage-runtimeJS` = runtime.js
lazy val plugin =
Project("scalac-scoverage-plugin", file("scalac-scoverage-plugin"))
.dependsOn(`scalac-scoverage-runtimeJVM` % Test)
.settings(
name := "scalac-scoverage-plugin",
crossTarget := target.value / s"scala-${scalaVersion.value}",
crossVersion := CrossVersion.full,
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-xml" % "2.0.0",
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided
),
sharedSettings
)
.settings(
(Test / unmanagedSourceDirectories) += (Test / sourceDirectory).value / "scala-2.12+"
)
addCommandAlias(
"styleFix",
"scalafixAll ; scalafmtAll ; scalafmtSbt"
)
addCommandAlias(
"styleCheck",
"scalafmtCheckAll ; scalafmtSbtCheck ; scalafix --check"
)