Repository navigation
Expand file tree
/
Copy pathbuild.sbt
More file actions
149 lines (133 loc) · 5.21 KB
/
Copy pathbuild.sbt
File metadata and controls
149 lines (133 loc) · 5.21 KB
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
val scala_2_13 = "2.13.18"
val scala_3 = "3.3.8"
val mainScalaVersion = scala_3
val supportedScalaVersions = Seq(scala_2_13, scala_3)
ThisBuild / crossScalaVersions := supportedScalaVersions
ThisBuild / scalaVersion := mainScalaVersion
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11"), JavaSpec.temurin("17"))
ThisBuild / githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v")),
RefPredicate.Equals(Ref.Branch("master")))
ThisBuild / tlBaseVersion := "0.7"
ThisBuild / tlCiHeaderCheck := false
ThisBuild / publishTo := {
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
else localStaging.value
}
lazy val noPublishSettings =
Seq(
publishArtifact := false,
skip / publish := true)
lazy val baseSettings = Seq(
organization := "pl.iterators",
organizationName := "Iterators",
organizationHomepage := Some(url("https://www.iteratorshq.com")),
pomIncludeRepository := const(true),
scalacOptions ++= {
Seq(
"-encoding",
"UTF-8",
"-feature",
"-language:implicitConversions") ++
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) => Seq(
"-unchecked",
"-source:3.0-migration")
case _ => Seq(
"-deprecation",
"-Xfatal-warnings",
"-Wunused:imports,privates,locals",
"-Wvalue-discard")
})
},
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(id = "lsowa",
name = "Łukasz Sowa",
email = "lsowa@iteratorshq.com",
url = url("https://github.com/luksow"))),
scmInfo := Some(
ScmInfo(browseUrl = url("https://github.com/theiterators/http4s-stir"),
connection = "scm:git:https://github.com/theiterators/http4s-stir.git")),
crossScalaVersions := supportedScalaVersions,
scalafmtOnCompile := true)
val http4sDsl = Def.setting("org.http4s" %%% "http4s-dsl" % "0.23.36")
val http4sEmber = Def.setting("org.http4s" %%% "http4s-ember-server" % "0.23.36")
val fs2Core = Def.setting("co.fs2" %%% "fs2-core" % "3.13.0")
val fs2Io = Def.setting("co.fs2" %%% "fs2-io" % "3.13.0")
val http4sClient = Def.setting(
"org.http4s" %%% "http4s-ember-client" % "0.23.36")
val circeCore = Def.setting("io.circe" %%% "circe-core" % "0.14.16")
val circeGeneric = Def.setting("io.circe" %%% "circe-generic" % "0.14.16")
val circeParser = Def.setting("io.circe" %%% "circe-parser" % "0.14.16")
val http4sCirce = Def.setting("org.http4s" %%% "http4s-circe" % "0.23.36")
val scalatest = Def.setting("org.scalatest" %%% "scalatest" % "3.2.20")
val specs2 = Def.setting("org.specs2" %%% "specs2-core" % "4.23.0")
val scalaXml = Def.setting("org.scala-lang.modules" %%% "scala-xml" % "2.4.0")
lazy val core = crossProject(JVMPlatform, NativePlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(baseSettings *)
.settings(
name := "http4s-stir",
libraryDependencies ++= Seq(http4sDsl.value, http4sEmber.value) ++ Seq(fs2Core.value,
fs2Io.value) ++ Seq(scalaXml.value),
Compile / doc / scalacOptions -= "-Xfatal-warnings")
lazy val coreTests = crossProject(JVMPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("core-tests"))
.settings(baseSettings *)
.settings(noPublishSettings *)
.settings(
name := "http4s-stir-tests",
libraryDependencies ++= Seq(http4sDsl.value, http4sEmber.value) ++
Seq(circeCore.value, circeGeneric.value, circeParser.value, http4sCirce.value) ++
Seq(
scalatest.value % Test,
specs2.value % Test))
.dependsOn(
testkit % "test",
core % "test->test")
lazy val testkit = crossProject(JVMPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("testkit"))
.settings(baseSettings *)
.settings(
name := "http4s-stir-testkit",
libraryDependencies ++= Seq(http4sClient.value) ++ Seq(
scalatest.value % "provided",
specs2.value % "provided"))
.dependsOn(core)
lazy val examples = crossProject(JVMPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("examples"))
.settings(baseSettings *)
.settings(noPublishSettings *)
.settings(
name := "http4s-stir-examples",
libraryDependencies ++= Seq(http4sDsl.value, http4sEmber.value) ++ Seq(circeCore.value, circeGeneric.value,
circeParser.value, http4sCirce.value) ++ Seq(
specs2.value % Test,
scalatest.value % Test))
.dependsOn(core, testkit % Test)
lazy val docs = project
.in(file("stir-docs"))
.dependsOn(core.jvm % "compile->compile")
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(baseSettings *)
.settings(noPublishSettings *)
.settings(
name := "docs",
description := "http4s-stir documentation",
moduleName := "stir-docs",
libraryDependencies ++= Seq(circeCore.value, circeGeneric.value, circeParser.value, http4sCirce.value),
mdocVariables := Map(
"VERSION" -> version.value
))
lazy val http4sStir = tlCrossRootProject.aggregate(core, testkit, examples, coreTests, docs)
.settings(baseSettings *)