-
Notifications
You must be signed in to change notification settings - Fork 174
/
build.sbt
40 lines (34 loc) · 1.07 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
name := "pureconfig-example"
version := "1.0"
scalaVersion := "2.12.20"
val VersionPattern = """ThisBuild / version := "([^"]*)"""".r
val pureconfigVersion = IO.read(file("../version.sbt")).trim match {
case VersionPattern(ver) => ver
case ex =>
println(s"""'$ex'""")
throw new Exception("Could not parse PureConfig version")
}
libraryDependencies += "com.github.pureconfig" %% "pureconfig" % pureconfigVersion
crossScalaVersions := Seq("2.12.20", "2.13.14")
val versionSpecificFlags =
Def.setting {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) =>
// Excluding -byname-implicit is required for Scala 2.13 due to https://github.com/scala/bug/issues/12072
Seq("-Xlint:_,-byname-implicit", "-Vimplicits")
case _ =>
Seq("-Xlint:_")
}
}
scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-language:experimental.macros",
"-feature",
"-unchecked",
"-Xfatal-warnings",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard"
) ++ versionSpecificFlags.value
scalafmtOnCompile := true