-
Notifications
You must be signed in to change notification settings - Fork 1
/
compiler.sbt
73 lines (62 loc) · 1.66 KB
/
compiler.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
ThisBuild / scalaVersion := "2.12.19"
ThisBuild / crossScalaVersions := Seq(scalaVersion.value, "2.13.14")
ThisBuild / crossVersion := CrossVersion.binary
ThisBuild / scalacOptions ++= Seq(
"-encoding", "UTF-8", "-target:jvm-1.8",
"-unchecked",
"-feature",
"-Xlint",
"-g:vars"
)
inThisBuild(Seq(// scalafix
addCompilerPlugin(scalafixSemanticdb),
scalacOptions ++= Seq(
"-Yrangepos",
"-P:semanticdb:synthetics:on"
)
))
ThisBuild / scalacOptions ++= {
if (scalaBinaryVersion.value == "2.12") {
Seq(
"-Xmax-classfile-name", "128",
"-Ywarn-numeric-widen",
"-Ywarn-dead-code",
"-Ywarn-value-discard",
"-Ywarn-infer-any",
"-Ywarn-unused",
"-Ywarn-unused-import",
"-Ywarn-macros:after"
)
} else {
Seq(
"-explaintypes",
"-Wnumeric-widen",
"-Wdead-code",
"-Wvalue-discard",
"-Wextra-implicit",
"-Wmacros:after",
"-Wunused")
}
}
ThisBuild / Compile / console / scalacOptions ~= {
_.filterNot(o =>
o.startsWith("-X") || o.startsWith("-Y") || o.startsWith("-P:silencer"))
}
Test / scalacOptions ~= {
_.filterNot(_ == "-Xfatal-warnings")
}
Compile / console / scalacOptions ~= {
_.filterNot { opt => opt.startsWith("-X") || opt.startsWith("-Y") }
}
Test / console / scalacOptions ~= {
_.filterNot { opt => opt.startsWith("-X") || opt.startsWith("-Y") }
}
ThisBuild / libraryDependencies ++= {
val silencerVersion = "1.7.17"
Seq(
compilerPlugin(("com.github.ghik" %% "silencer-plugin" % silencerVersion).
cross(CrossVersion.full)),
("com.github.ghik" %% "silencer-lib" % silencerVersion % Provided).
cross(CrossVersion.full)
)
}