forked from tricreo/baseunits-scala
-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.sbt
93 lines (86 loc) · 2.74 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._
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 := "org.sisioh",
homepage := Some(url("https://github.com/j5ik2o/baseunits-scala")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
id = "j5ik2o",
name = "Junichi Kato",
email = "j5ik2o@gmail.com",
url = url("https://blog.j5ik2o.me")
)
),
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(
),
libraryDependencies ++= Seq(
"junit" % "junit" % "4.13" % "test",
"org.scalactic" %% "scalactic" % "3.0.9",
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
"com.github.sbt" % "junit-interface" % "0.13.3" % "test->default",
"org.mockito" % "mockito-core" % "3.9.0" % "test",
"commons-io" % "commons-io" % "2.11.0"
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2L, scalaMajor)) if scalaMajor == 13 =>
Seq(
)
case Some((2L, scalaMajor)) if scalaMajor != 13 =>
Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % Versions.scalaCollectionCompatVersion
)
}
},
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision,
Test / publishArtifact := false,
Test / fork := true,
Test / parallelExecution := false
)
lazy val library = (project in file("library")).settings(
baseSettings ++ Seq(
name := "baseunits-scala"
)
)
lazy val example = (project in file("example")).settings(
baseSettings ++ Seq(
name := "baseunits-scala-example"
)
) dependsOn library
lazy val root = (project in file(".")).settings(
baseSettings ++ Seq(
name := "baseunits-scala-project",
publish / skip := true
)
) aggregate (library, example)
// --- Custom commands
addCommandAlias("lint", ";scalafmtCheck;test:scalafmtCheck;scalafmtSbtCheck;scalafixAll --check")
addCommandAlias("fmt", ";scalafmtAll;scalafmtSbt")