-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
163 lines (155 loc) · 6.23 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
name := "ZIO Pravega"
val scala213 = "2.13.15"
val scala33 = "3.5.2"
val mainScala = scala33
val allScala = Seq(scala33, scala213)
val zioVersion = "2.1.14"
val pravegaVersion = "0.13.0"
def scalacOptionsFor(scalaVersion: String): Seq[String] =
CrossVersion.partialVersion(scalaVersion) match {
case Some((3, _)) => Seq("-Wunused:all")
case _ => Seq("-Xsource:3")
}
inThisBuild(
List(
organization := "dev.cheleb",
homepage := Some(url("https://github.com/cheleb/zio-pravega")),
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
useCoursier := false,
scalaVersion := mainScala,
crossScalaVersions := allScala,
scalacOptions ++= Seq(
// "-deprecation",
"-Xfatal-warnings"
),
Test / parallelExecution := false,
Test / fork := true,
run / fork := true,
sonatypeCredentialHost := "s01.oss.sonatype.org",
sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
scmInfo := Some(
ScmInfo(
url("https://github.com/cheleb/zio-pravega/"),
"scm:git:[email protected]:cheleb/zio-pravega.git"
)
),
developers := List(
Developer(
"cheleb",
"Olivier NOUGUIER",
url("https://github.com/cheleb")
)
),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision, // only required for Scala 2.x
// scalafixScalaBinaryVersion := "3.4",
// scalafixOnCompile := true,
ThisBuild / scalafixDependencies +=
"dev.cheleb" %% "zio-module-pattern" % "0.0.5",
Compile / wartremoverErrors ++= Warts.allBut(
Wart.Any,
Wart.Nothing,
Wart.DefaultArguments,
Wart.ImplicitParameter,
Wart.Overloading
)
)
)
lazy val root = project
.in(file("."))
.aggregate(pravega)
.settings(
publish / skip := true
)
lazy val pravega =
project
.in(file("modules/zio-pravega"))
.enablePlugins(BuildInfoPlugin)
.settings(
name := "zio-pravega",
scalafmtOnCompile := true,
fork := true,
Global / scalacOptions ++= scalacOptionsFor(scalaVersion.value)
)
.settings(
buildInfoKeys := Seq[BuildInfoKey](
organization,
name,
version,
scalaVersion,
sbtVersion,
isSnapshot
),
buildInfoPackage := "zio.pravega"
)
.settings(
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
// resolvers += "Pravega RC" at "https://oss.sonatype.org/content/repositories/iopravega-1206",
libraryDependencies ++= Seq(
"com.typesafe" % "config" % "1.4.3",
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test,
"dev.zio" %% "zio-logging-slf4j-bridge" % "2.4.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"io.pravega" % "pravega-client" % pravegaVersion,
"org.testcontainers" % "testcontainers" % "1.20.4" % Test,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0",
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % Test,
"io.envoyproxy.protoc-gen-validate" % "pgv-java-stub" % "0.6.13" % Test,
"com.thesamet.scalapb" %% "scalapb-runtime" % scalapb.compiler.Version.scalapbVersion % "protobuf"
),
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")
)
.settings(
libraryDependencies ++= Seq(
"com.thesamet.scalapb.common-protos" %% "proto-google-common-protos-scalapb_0.11" % "2.9.6-0" % "protobuf",
"com.thesamet.scalapb.common-protos" %% "proto-google-common-protos-scalapb_0.11" % "2.9.6-0" % Test,
"com.thesamet.scalapb.common-protos" %% "pgv-proto-scalapb_0.11" % "0.6.13-0" % "protobuf",
"com.thesamet.scalapb.common-protos" %% "pgv-proto-scalapb_0.11" % "0.6.13-0" % Test
),
Test / PB.targets := Seq(
scalapb.gen(scala3Sources = true) -> (Test / sourceManaged).value / "scalapb"
)
)
lazy val saga = project
.in(file("modules/zio-pravega-saga"))
.dependsOn(pravega)
.settings(
name := "zio-pravega-saga"
)
.settings(
publish / skip := true
)
lazy val docs = project // new documentation project
.in(file("zio-pravega-docs")) // important: it must not be docs/
.dependsOn(pravega)
.settings(
publish / skip := true,
moduleName := "zio-pravega-docs",
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(pravega),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
mdocVariables := Map(
"VERSION" -> sys.env.getOrElse("VERSION", version.value),
"ORG" -> organization.value
)
)
.disablePlugins(WartRemover)
.enablePlugins(MdocPlugin, ScalaUnidocPlugin, PlantUMLPlugin)
.settings(
plantUMLSource := (root / baseDirectory).value / "docs" / "_docs",
Compile / plantUMLTarget := "mdoc/_assets/images"
)
.settings(libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.5.15")
addCommandAlias("fmt", "all scalafmtSbt scalafmt test / scalafmt")
addCommandAlias(
"check",
"all scalafmtSbtCheck scalafmtCheck test / scalafmtCheck"
)