-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
93 lines (86 loc) · 2.48 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
import Dependencies._
import sbt._
ThisBuild / scalafixScalaBinaryVersion := CrossVersion.binaryScalaVersion(scalaVersion.value)
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.chatwork",
homepage := Some(url("https://github.com/chatwork/scala-ulid")),
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.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)
),
resolvers ++= Seq(
Resolver.sonatypeRepo("snapshots"),
Resolver.sonatypeRepo("releases")
),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
Test / publishArtifact := false,
Test / parallelExecution := false
)
val library = (project in file("library"))
.settings(baseSettings)
.settings(
name := "scala-ulid",
libraryDependencies ++= Seq(
scalatest.scalatest % Test,
scalatest.scalacheck % Test
)
)
lazy val benchmark = (project in file("benchmark"))
.settings(baseSettings)
.settings(
name := "scala-ulid-benchmark",
publish / skip := true,
libraryDependencies ++= Seq(
ulid.ulidCreator,
ulid.ulid,
ulid.ulid4s,
ulid.airframe
)
)
.enablePlugins(JmhPlugin)
.dependsOn(library)
val root = (project in file("."))
.settings(baseSettings)
.settings(
name := "scala-ulid-root",
publish / skip := true
)
.aggregate(library)
// --- Custom commands
addCommandAlias("lint", ";scalafmtCheck;test:scalafmtCheck;scalafmtSbtCheck;scalafixAll --check")
addCommandAlias("fmt", ";scalafmtAll;scalafmtSbt")