-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
101 lines (91 loc) · 2.42 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
95
96
97
98
99
100
101
import Dependencies._
import MyUtil._
ThisBuild / organization := "dev.insideyou"
ThisBuild / scalaVersion := "3.3.1"
lazy val buildinfo =
project
.in(file("."))
.settings(commonSettings)
.aggregate(core, `delivery-cli`, main)
lazy val core =
project
.in(file("core"))
.settings(commonSettings)
.settings(autoImportSettings)
.settings(dependencies)
lazy val `delivery-cli` =
project
.in(file("delivery-cli"))
.dependsOn(`core` % Cctt)
.settings(commonSettings)
.settings(autoImportSettings)
lazy val main =
project
.in(file("main"))
.dependsOn(`delivery-cli` % Cctt)
.settings(commonSettings)
.settings(autoImportSettings)
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoPackage := "dev.insideyou.buildinfo.build",
buildInfoKeys :=
Seq[BuildInfoKey](
version,
scalaVersion,
sbtVersion,
"gitHash" -> fullGitHash,
"gitBranch" -> branch,
),
buildInfoOptions ++=
Seq(
Some(BuildInfoOption.ToMap),
if (insideCI.value) Some(BuildInfoOption.BuildTime) else None,
).flatten,
)
lazy val commonSettings = {
lazy val commonScalacOptions = Seq(
Compile / console / scalacOptions := {
(Compile / console / scalacOptions)
.value
.filterNot(_.contains("wartremover"))
.filterNot(Scalac.Lint.toSet)
.filterNot(Scalac.FatalWarnings.toSet) :+ "-Wconf:any:silent"
},
Test / console / scalacOptions :=
(Compile / console / scalacOptions).value,
)
lazy val otherCommonSettings = Seq(
update / evictionWarningOptions := EvictionWarningOptions.empty
)
Seq(
commonScalacOptions,
otherCommonSettings,
).reduceLeft(_ ++ _)
}
lazy val autoImportSettings = Seq(
scalacOptions +=
Seq(
"java.lang",
"scala",
"scala.Predef",
"scala.annotation",
"scala.util.chaining",
).mkString(start = "-Yimports:", sep = ",", end = ""),
Test / scalacOptions +=
Seq(
"org.scalacheck",
"org.scalacheck.Prop",
).mkString(start = "-Yimports:", sep = ",", end = ""),
)
lazy val dependencies = Seq(
libraryDependencies ++= Seq(
// main dependencies
),
libraryDependencies ++= Seq(
com.eed3si9n.expecty.expecty,
org.scalacheck.scalacheck,
org.scalameta.`munit-scalacheck`,
org.scalameta.munit,
org.typelevel.`discipline-munit`,
).map(_ % Test),
)