-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.sbt
154 lines (136 loc) · 4.75 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Global / onChangedBuildSource := ReloadOnSourceChanges
val V = new {
val cats = "2.10.0"
val catsEffect = "3.5.4"
val circe = "0.14.8"
val http4s = "0.23.28"
val munit = "1.0.0-M11"
val munitCatsEffect = "2.0.0"
val scala = "3.3.4"
val slf4j = "1.7.36"
val slf4j2 = "2.0.16"
val tzdb = "2.5.0"
}
val D = new {
val slf4jApi = "org.slf4j" % "slf4j-api" % V.slf4j
val slf4jApi2 = "org.slf4j" % "slf4j-api" % V.slf4j2
val catsCore = Def.setting("org.typelevel" %%% "cats-core" % V.cats)
val catsEffect = Def.setting("org.typelevel" %%% "cats-effect" % V.catsEffect)
val catsEffectTestKit = Def.setting("org.typelevel" %%% "cats-effect-testkit" % V.catsEffect)
val http4s = Def.setting("org.http4s" %%% "http4s-core" % V.http4s)
val munit = Def.setting("org.scalameta" %%% "munit" % V.munit)
val munitCatsEffect = Def.setting("org.typelevel" %%% "munit-cats-effect" % V.munitCatsEffect)
val munitScalacheck = Def.setting("org.scalameta" %%% "munit-scalacheck" % V.munit)
val circe = Def.setting("io.circe" %%% "circe-parser" % V.circe)
val tzdb = Def.setting("io.github.cquiroz" %%% "scala-java-time-tzdb" % V.tzdb)
}
/*
CI RELEASE SECTION: BEGIN
*/
inThisBuild(
List(
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
organization := "org.legogroup",
homepage := Some(url("https://github.com/LEGO/woof")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"hejfelix",
"Felix Bjært Hargreaves",
url("https://github.com/hejfelix"),
),
),
),
)
ThisBuild / versionScheme := Some("early-semver")
/*
CI RELEASE SECTION: END
*/
val commonSettings = Seq(
scalaVersion := V.scala,
organization := "org.legogroup",
scalacOptions ++= Seq("-source", "future", "-deprecation"),
)
def nameForFile(file: File): String = s"woof-${file.getName()}"
def woofProject(file: File): Project =
Project(nameForFile(file), file)
.settings(commonSettings)
.settings(name := nameForFile(file))
lazy val docs =
project
.in(file("docs-target"))
.settings(commonSettings, mdocIn := file("docs"), mdocOut := file("."), publish / skip := true)
.enablePlugins(MdocPlugin)
.dependsOn(core.jvm, http4s.jvm, slf4j)
lazy val root =
project
.in(file("."))
.aggregate(
List(
core,
http4s,
slf4j,
slf4j2,
slf4jCommon,
).flatMap(_.componentProjects).map(_.project): _*
)
.settings(
publish / skip := true,
)
val coreFolder = file("./modules/core")
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(coreFolder)
.settings(commonSettings)
.settings(
name := nameForFile(coreFolder),
libraryDependencies ++= Seq(
D.catsCore.value,
D.catsEffect.value,
D.munit.value % Test,
D.munitCatsEffect.value % Test,
D.catsEffectTestKit.value % Test,
D.circe.value % Test,
D.munitScalacheck.value % Test,
D.tzdb.value % Test
),
)
val http4sFolder = file("./modules/http4s")
lazy val http4s = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Pure)
.in(http4sFolder)
.settings(
name := nameForFile(http4sFolder),
libraryDependencies += D.http4s.value,
)
.settings(commonSettings)
.dependsOn(core % "compile->compile;test->test") // we also want the test utils
lazy val slf4j = woofProject(file("./modules/slf4j"))
.settings(libraryDependencies += D.slf4jApi)
.dependsOn(slf4jCommon % "compile->compile;test->test")
lazy val slf4j2 = woofProject(file("./modules/slf4j-2"))
.settings(libraryDependencies += D.slf4jApi2)
.dependsOn(slf4jCommon % "compile->compile;test->test")
lazy val slf4jCommon =
woofProject(file("./modules/slf4j-common"))
.dependsOn(core.jvm % "compile->compile;test->test")
lazy val examples = project
.in(file("./modules/examples"))
.settings(commonSettings)
.settings(publish / skip := true)
.dependsOn(core.jvm)
lazy val examplesJs = crossProject(JSPlatform)
.withoutSuffixFor(JSPlatform)
.crossType(CrossType.Pure)
.in(file("./modules/examples-scalajs"))
.settings(commonSettings)
.settings(publish / skip := true)
.jsConfigure(_.settings(scalaJSUseMainModuleInitializer := true))
.dependsOn(core)
lazy val benchmarks = project
.in(file("./modules/benchmarks"))
.dependsOn(core.jvm)
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(publish / skip := true)