forked from zio/zio-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
135 lines (123 loc) · 4.32 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
import java.util.concurrent.TimeUnit
import BuildHelper.{Scala213, publishSetting, stdSettings}
import scala.concurrent.duration.FiniteDuration
import sbt.enablePlugins
// ZIO Version
val zioVersion = "1.0.10"
val zioConfigVersion = "1.0.2"
val releaseDrafterVersion = "5"
lazy val root = (project in file("."))
.settings(stdSettings("root"))
.settings(publishSetting(false))
.aggregate(zhttp, zhttpBenchmarks, zhttpTest, example)
// CI Configuration
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' }}"),
),
)
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 :=
WorkflowJob(
"fmtCheck",
"Format",
List(
WorkflowStep.Run(List(s"sbt ++${Scala213} fmtCheck"), name = Some("Check formatting")),
),
scalas = List(Scala213),
).steps
// Test Configuration
ThisBuild / libraryDependencies ++=
Seq(
"dev.zio" %% "zio-test" % zioVersion % "test",
"dev.zio" %% "zio-test-sbt" % zioVersion % "test",
)
ThisBuild / testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")
// Projects
// Project zio-http
lazy val zhttp = (project in file("./zio-http"))
.settings(stdSettings("zhttp"))
.settings(publishSetting(true))
.settings(
ThisBuild / homepage := Some(url("https://github.com/dream11/zio-http")),
ThisBuild / scmInfo :=
Some(
ScmInfo(url("https://github.com/dream11/zio-http"), "scm:git@github.com:dream11/zio-http.git"),
),
ThisBuild / developers :=
List(
Developer(
"tusharmath",
"Tushar Mathur",
"tushar@dream11.com",
new URL("https://github.com/tusharmath"),
),
Developer(
"amitksingh1490",
"Amit Kumar Singh",
"amit.singh@dream11.com",
new URL("https://github.com/amitksingh1490"),
),
),
libraryDependencies ++=
Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"io.netty" % "netty-all" % "4.1.66.Final",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.5.0",
),
)
// Project Benchmarks
lazy val zhttpBenchmarks = (project in file("./zio-http-benchmarks"))
.enablePlugins(JmhPlugin)
.dependsOn(zhttp)
.settings(stdSettings("zhttpBenchmarks"))
.settings(publishSetting(false))
.settings(
libraryDependencies ++=
Seq(
"dev.zio" %% "zio" % zioVersion,
),
)
// Testing Package
lazy val zhttpTest = (project in file("./zio-http-test"))
.dependsOn(zhttp)
.settings(stdSettings("zhttp-test"))
.settings(publishSetting(true))
lazy val example = (project in file("./example"))
.settings(stdSettings("example"))
.settings(publishSetting(false))
.settings(
fork := true,
Compile / run / mainClass := Option("HelloWorld"),
libraryDependencies ++= Seq(
"com.github.jwt-scala" %% "jwt-core" % "9.0.0",
),
)
.dependsOn(zhttp)
addCommandAlias("fmt", "scalafmt; test:scalafmt; sFix;")
addCommandAlias("fmtCheck", "scalafmtCheck; test:scalafmtCheck; sFixCheck")
addCommandAlias("sFix", "scalafix OrganizeImports; test:scalafix OrganizeImports")
addCommandAlias("sFixCheck", "scalafix --check OrganizeImports; test:scalafix --check OrganizeImports")
Global / onChangedBuildSource := ReloadOnSourceChanges
Global / watchAntiEntropy := FiniteDuration(2000, TimeUnit.MILLISECONDS)