-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
94 lines (89 loc) · 2.67 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
import sbt._
def crossScalacOptions(scalaVersion: String): Seq[String] =
CrossVersion.partialVersion(scalaVersion) match {
case Some((3L, _)) =>
Seq(
"-source:3.0-migration",
"-Xignore-scala2-macros"
)
case Some((2L, scalaMajor)) if scalaMajor >= 12 =>
Seq(
"-Ydelambdafy:method",
"-target:jvm-1.8",
"-Yrangepos",
"-Ywarn-unused"
)
}
lazy val baseSettings = Seq(
organization := "com.chatwork",
homepage := Some(url("https://github.com/chatwork/scala-jwk")),
licenses := List("The MIT License" -> url("http://opensource.org/licenses/MIT")),
developers := List(
Developer(
id = "j5ik2o",
name = "Junichi Kato",
email = "[email protected]",
url = url("https://blog.j5ik2o.me")
),
Developer(
id = "exoego",
name = "TATSUNO Yasuhiro",
email = "[email protected]",
url = url("https://www.exoego.net")
)
),
scalaVersion := Versions.scala213Version,
crossScalaVersions := Seq(Versions.scala212Version, Versions.scala213Version, Versions.scala3Version),
scalacOptions ++= (Seq(
"-unchecked",
"-feature",
"-deprecation",
"-encoding",
"UTF-8",
"-language:_"
) ++ crossScalacOptions(scalaVersion.value)),
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots")
),
Test / publishArtifact := false,
Test / parallelExecution := false,
Compile / doc / sources := {
val old = (Compile / doc / sources).value
if (scalaVersion.value == Versions.scala3Version) {
Nil
} else {
old
}
},
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
// Remove me when scalafix is stable and feature-complete on Scala 3
ThisBuild / scalafixScalaBinaryVersion := (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => CrossVersion.binaryScalaVersion(scalaVersion.value)
case _ => CrossVersion.binaryScalaVersion(Versions.scala212Version)
})
)
val library = (project in file("library"))
.settings(baseSettings)
.settings(
name := "scala-jwk",
libraryDependencies ++= Seq(
scalatest.scalatest % Test,
scalacheck.scalacheck % Test,
scalaLang.java8Compat,
j5ik2o.base64scala,
circe.core,
circe.generic,
circe.parser
)
)
val root = (project in file("."))
.settings(baseSettings)
.settings(
name := "scala-jwk-root",
publish / skip := true
)
.aggregate(library)
// --- Custom commands
addCommandAlias("lint", ";scalafmtCheck;test:scalafmtCheck;scalafmtSbtCheck;scalafixAll --check")
addCommandAlias("fmt", ";scalafmtAll;scalafmtSbt;scalafix RemoveUnused")