-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
189 lines (170 loc) · 5.87 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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
lazy val zio2Version = "2.1.1"
lazy val zioLoggingVersion = "2.2.4"
lazy val zio1Version = "1.0.18"
lazy val jeromqVersion = "0.5.3"
lazy val scala3Version = "3.4.2"
lazy val scala213Version = "2.13.14"
lazy val mainScalaVersion = scala3Version
lazy val supportedScalaVersions = List(scala3Version, scala213Version)
ThisBuild / organization := "io.github.unit-finance"
// ThisBuild / organization := "co.unit"
ThisBuild / organizationName := "Unit"
ThisBuild / organizationHomepage := Some(url("https://unit.co"))
ThisBuild / version := "0.0.1-SNAPSHOT"
ThisBuild / scalaVersion := mainScalaVersion
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/unit-finance/zio-raft"),
"scm:[email protected]:unit-finance/zio-raft.git"
)
)
ThisBuild / homepage := Some(url("https://github.com/unit-finance/zio-raft"))
ThisBuild / publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
ThisBuild / credentials += Credentials(
"Sonatype Nexus Repository Manager",
"s01.oss.sonatype.org",
sys.env.getOrElse("SONATYPE_USERNAME", ""),
sys.env.getOrElse("SONATYPE_PASSWORD", "")
)
scalaVersion := mainScalaVersion
resolvers +=
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
lazy val root = project
.in(file("."))
.aggregate(raft, kvstore, zio1zmq, zio2zmq, raftZmq, stores, ziolmdb)
.settings(
publish / skip := true,
crossScalaVersions := Nil
)
lazy val raft = project
.in(file("raft"))
.settings(
name := "zio-raft",
scalaVersion := mainScalaVersion,
scalacOptions ++= Seq("-indent", "-rewrite", "-Wunused:imports"),
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework"),
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zio2Version,
"dev.zio" %% "zio-test" % zio2Version % Test,
"dev.zio" %% "zio-test-sbt" % zio2Version % Test,
"dev.zio" %% "zio-nio" % "2.0.0",
"dev.zio" %% "zio-prelude" % "1.0.0-RC26",
)
)
lazy val kvstore = project
.in(file("kvstore"))
.settings(
name := "kvstore",
publish / skip := true,
scalaVersion := mainScalaVersion,
scalacOptions ++= Seq("-indent", "-rewrite", "-Wunused:imports"),
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zio2Version,
"dev.zio" %% "zio-prelude" % "1.0.0-RC26",
"dev.zio" %% "zio-http" % "3.0.0-RC8",
),
excludeDependencies += "org.scala-lang.modules" % "scala-collection-compat_2.13"
)
.dependsOn(raft, raftZmq, stores)
lazy val raftZmq = project
.in(file("raft-zmq"))
.settings(
name := "zio-raft-zmq",
scalaVersion := mainScalaVersion,
scalacOptions ++= Seq("-indent", "-rewrite", "-Wunused:imports"),
libraryDependencies ++= Seq(
"dev.zio" %% "zio-test" % zio2Version % Test,
"dev.zio" %% "zio-test-sbt" % zio2Version % Test,
"org.scodec" %% "scodec-bits" % "1.1.37",
"org.scodec" %% "scodec-core" % "2.2.1"
)
)
.dependsOn(raft, zio2zmq)
lazy val zio1zmq = project
.in(file("zio1-zmq"))
.settings(
name := "zio1-zmq",
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zio1Version,
"dev.zio" %% "zio-prelude" % "1.0.0-RC5",
"org.zeromq" % "jeromq" % jeromqVersion
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) => Seq("io.estatico" %% "newtype" % "0.4.4")
case Some((3, n)) => Seq()
case _ => Seq()
}
},
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) => List("-Xsource:3", "-Ymacro-annotations", "-Wunused:imports")
case Some((3, n)) => List("-Wunused:imports")
case _ => List()
}
}
)
lazy val zio2zmq = project
.in(file("zio2-zmq"))
.settings(
name := "zio2-zmq",
scalaVersion := mainScalaVersion,
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zio2Version,
"dev.zio" %% "zio-prelude" % "1.0.0-RC26",
"org.zeromq" % "jeromq" % jeromqVersion
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) => Seq("io.estatico" %% "newtype" % "0.4.4")
case Some((3, n)) => Seq()
case _ => Seq()
}
},
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) => List("-Xsource:3", "-Ymacro-annotations", "-Wunused:imports")
case Some((3, n)) => List("-Wunused:imports")
case _ => List()
}
}
)
lazy val ziolmdb = project
.in(file("zio-lmdb"))
.settings(
name := "zio-lmdb",
scalaVersion := mainScalaVersion,
scalacOptions ++= Seq("-indent", "-rewrite", "-Wunused:imports"),
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zio2Version,
"dev.zio" %% "zio-nio" % "2.0.0",
"dev.zio" %% "zio-streams" % zio2Version,
"dev.zio" %% "zio-test" % zio2Version % Test,
"dev.zio" %% "zio-test-sbt" % zio2Version % Test,
"org.lmdbjava" % "lmdbjava" % "0.9.0"
)
)
lazy val stores = project
.in(file("stores"))
.settings(
name := "zio-raft-stores",
scalaVersion := mainScalaVersion,
scalacOptions ++= Seq("-indent", "-rewrite", "-Wunused:imports"),
libraryDependencies ++= Seq(
"dev.zio" %% "zio-test" % zio2Version % Test,
"dev.zio" %% "zio-test-sbt" % zio2Version % Test,
"org.scodec" %% "scodec-bits" % "1.1.37",
"org.scodec" %% "scodec-core" % "2.2.1",
"dev.zio" %% "zio-nio" % "2.0.0"
)
)
.dependsOn(raft, ziolmdb)