-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sbt
68 lines (64 loc) · 2.14 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
import Dependencies._
def crossScalacOptions(scalaVersion: String): Seq[String] = CrossVersion.partialVersion(scalaVersion) match {
case Some((2L, scalaMajor)) if scalaMajor >= 12 =>
Seq.empty
case Some((2L, scalaMajor)) if scalaMajor <= 11 =>
Seq("-Yinline-warnings")
}
lazy val baseSettings = Seq(
organization := "com.github.j5ik2o",
homepage := Some(url("https://github.com/j5ik2o/sw4jj")),
licenses := List("The MIT License" -> url("http://opensource.org/licenses/MIT")),
developers := List(
Developer(
id = "j5ik2o",
name = "Junichi Kato",
email = "j5ik2o@gmail.com",
url = url("https://blog.j5ik2o.me")
)
),
scalaVersion := Versions.scala211Version,
crossScalaVersions := Seq(Versions.scala211Version, Versions.scala212Version, Versions.scala213Version),
scalacOptions ++= (Seq(
"-feature",
"-deprecation",
"-unchecked",
"-encoding",
"UTF-8",
"-language:_",
"-Ydelambdafy:method",
"-target:jvm-1.8",
"-Yrangepos",
"-Ywarn-unused"
) ++ crossScalacOptions(scalaVersion.value)),
libraryDependencies ++= Seq(
scalatest.scalatest % Test
),
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
Test / publishArtifact := false,
Test / fork := true,
Test / parallelExecution := false
)
val root = (project in file("."))
.settings(baseSettings)
.settings(
name := "sw4jj",
libraryDependencies ++= Seq(
auth0.javaJwt
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2L, scalaMajor)) if scalaMajor == 13 =>
Seq.empty
case Some((2L, scalaMajor)) if scalaMajor <= 12 =>
Seq(
scalaLang.scalaCollectionCompat
)
}
}
)
// --- Custom commands
addCommandAlias("lint", ";scalafmtCheck;test:scalafmtCheck;scalafmtSbtCheck;scalafixAll --check")
addCommandAlias("fmt", ";scalafmtAll;scalafmtSbt")