forked from zio/zio-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
172 lines (158 loc) · 5.5 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
import BuildHelper._
import Dependencies._
import sbt.librarymanagement.ScalaArtifacts.isScala3
val releaseDrafterVersion = "5"
// Setting default log level to INFO
val _ = sys.props += ("ZIOHttpLogLevel" -> Debug.ZIOHttpLogLevel)
ThisBuild / resolvers +=
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
// CI Configuration
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.graalvm("21.1.0", "11"), JavaSpec.temurin("8"))
ThisBuild / githubWorkflowPREventTypes := Seq(
PREventType.Opened,
PREventType.Synchronize,
PREventType.Reopened,
PREventType.Edited,
PREventType.Labeled,
)
ThisBuild / githubWorkflowAddedJobs :=
Seq(
WorkflowJob(
id = "update_release_draft",
name = "Release Drafter",
steps = List(WorkflowStep.Use(UseRef.Public("release-drafter", "release-drafter", s"v${releaseDrafterVersion}"))),
cond = Option("${{ github.base_ref == 'main' }}"),
),
) ++ ScoverageWorkFlow(50, 60) ++ BenchmarkWorkFlow() ++ JmhBenchmarkWorkflow(1)
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches += RefPredicate.StartsWith(Ref.Tag("v"))
ThisBuild / githubWorkflowPublish :=
Seq(
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}",
"CI_SONATYPE_RELEASE" -> "${{ secrets.CI_SONATYPE_RELEASE }}",
),
),
)
//scala fix isn't available for scala 3 so ensure we only run the fmt check
//using the latest scala 2.13
ThisBuild / githubWorkflowBuildPreamble := Seq(
WorkflowStep.Run(
name = Some("Check formatting"),
commands = List(s"sbt ++${Scala213} fmtCheck"),
cond = Some(s"matrix.scala == '${Scala213}'"),
),
)
ThisBuild / githubWorkflowBuildPostamble :=
WorkflowJob(
"checkDocGeneration",
"Check doc generation",
List(
WorkflowStep.Run(
commands = List(s"sbt ++${Scala213} doc"),
name = Some("Check doc generation"),
cond = Some("${{ github.event_name == 'pull_request' }}"),
),
),
scalas = List(Scala213),
).steps
inThisBuild(
List(
organization := "dev.zio",
homepage := Some(url("https://zio.dev/zio-http/")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
),
)
lazy val root = (project in file("."))
.settings(stdSettings("zio-http-root"))
.settings(publishSetting(false))
.aggregate(
zioHttp,
zioHttpBenchmarks,
zioHttpCli,
zioHttpExample,
zioHttpTestkit,
docs,
)
lazy val zioHttp = (project in file("zio-http"))
.settings(stdSettings("zio-http"))
.settings(publishSetting(true))
.settings(settingsWithHeaderLicense)
.settings(meta)
.settings(
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
libraryDependencies ++= netty ++ Seq(
`zio`,
`zio-streams`,
`zio-schema`,
`zio-schema-json`,
`zio-test`,
`zio-test-sbt`,
`netty-incubator`,
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n <= 12 => Seq(`scala-compact-collection`)
case _ => Seq.empty
}
},
)
lazy val zioHttpBenchmarks = (project in file("zio-http-benchmarks"))
.enablePlugins(JmhPlugin)
.settings(stdSettings("zio-http-benchmarks"))
.settings(publishSetting(false))
.settings(
libraryDependencies ++= Seq(
// "com.softwaremill.sttp.tapir" %% "tapir-akka-http-server" % "1.1.0",
"com.softwaremill.sttp.tapir" %% "tapir-http4s-server" % "1.2.13",
"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % "1.2.13",
// "dev.zio" %% "zio-interop-cats" % "3.3.0",
),
)
.dependsOn(zioHttp)
lazy val zioHttpCli = (project in file("zio-http-cli"))
.settings(stdSettings("zio-http-cli"))
.settings(libraryDependencies ++= Seq(`zio-cli`))
.dependsOn(zioHttp)
lazy val zioHttpExample = (project in file("zio-http-example"))
.settings(stdSettings("zio-http-example"))
.settings(publishSetting(false))
.settings(runSettings(Debug.Main))
.settings(libraryDependencies ++= Seq(`jwt-core`))
.dependsOn(zioHttp, zioHttpCli)
lazy val zioHttpTestkit = (project in file("zio-http-testkit"))
.settings(stdSettings("zio-http-testkit"))
.settings(publishSetting(true))
.settings(
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
libraryDependencies ++= netty ++ Seq(
`zio`,
`zio-test`,
`zio-test-sbt`,
),
)
.dependsOn(zioHttp)
lazy val docs = project
.in(file("zio-http-docs"))
.settings(
moduleName := "zio-http-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
projectName := "ZIO Http",
mainModuleName := (zioHttp / moduleName).value,
projectStage := ProjectStage.Development,
docsPublishBranch := "main",
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(zioHttp),
ciWorkflowName := "Continuous Integration",
libraryDependencies ++= Seq(
`jwt-core`,
"dev.zio" %% "zio-test" % ZioVersion,
),
)
.dependsOn(zioHttp)
.enablePlugins(WebsitePlugin)