-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
138 lines (125 loc) · 3.77 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
val zioVersion = "1.0.15"
val shapelessVersion = "2.3.9"
val msgpackVersion = "0.9.3"
val testContainersVersion = "0.40.8"
val logbackVersion = "1.2.11"
val scala2_12 = "2.12.15"
val scala2_13 = "2.13.8"
val compileAndTest = "compile->compile;test->test"
def compilerOptions(scalaVersion: String): Seq[String] = Seq(
"-deprecation",
"-unchecked",
"-encoding",
"UTF-8",
"-explaintypes",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:existentials",
"-language:postfixOps",
"-Ywarn-dead-code",
"-Xlint",
"-Xlint:constant",
"-Xlint:inaccessible",
"-Xlint:nullary-unit",
"-Xlint:type-parameter-shadow"
// "-Xlog-implicits"
) ++ (CrossVersion.partialVersion(scalaVersion) match {
case Some((2, scalaMajor)) if scalaMajor == 12 => scala212CompilerOptions
case Some((2, scalaMajor)) if scalaMajor == 13 => scala213CompilerOptions
})
lazy val scala212CompilerOptions = Seq(
"-Yno-adapted-args",
"-Xfuture",
"-Ypartial-unification",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-unused:implicits",
"-Ywarn-unused:imports",
"-Ywarn-unused:locals",
"-Ywarn-unused:params",
"-Ywarn-unused:patvars",
"-Ywarn-unused:privates",
"-Ywarn-value-discard",
"-Xlint:unsound-match"
)
lazy val scala213CompilerOptions = Seq(
"-Xlint:_,-byname-implicit",
"-Ymacro-annotations",
"-Wdead-code",
"-Wnumeric-widen",
"-Wunused:explicits",
"-Wunused:implicits",
"-Wunused:imports",
"-Wunused:locals",
"-Wunused:patvars",
"-Wunused:privates",
"-Wvalue-discard",
"-Xlint:deprecation",
"-Xlint:eta-sam",
"-Xlint:eta-zero",
"-Xlint:implicit-not-found",
"-Xlint:infer-any",
"-Xlint:nonlocal-return",
"-Xlint:unused",
"-Xlint:valpattern"
)
lazy val noPublish = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val buildSettings = Seq(
sonatypeProfileName := "com.nryanov",
organization := "com.nryanov.zio-tarantool",
homepage := Some(url("https://github.com/nryanov/zio-tarantool")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer(
"nryanov",
"Nikita Ryanov",
"ryanov.nikita@gmail.com",
url("https://nryanov.com")
)
),
scalaVersion := scala2_13,
crossScalaVersions := Seq(scala2_12, scala2_13),
scalacOptions ++= compilerOptions(scalaVersion.value),
Test / parallelExecution := false
)
lazy val macroSettings: Seq[Setting[_]] = Seq(
libraryDependencies ++= Seq(
scalaOrganization.value % "scala-compiler" % scalaVersion.value % Provided,
scalaOrganization.value % "scala-reflect" % scalaVersion.value % Provided
)
)
lazy val allSettings = buildSettings
lazy val zioTarantool =
project
.in(file("."))
.settings(moduleName := "zio-tarantool")
.settings(allSettings)
.settings(noPublish)
.aggregate(core, examples)
lazy val core = project
.in(file("core"))
.settings(allSettings)
.settings(macroSettings)
.settings(
moduleName := "zio-tarantool-core",
libraryDependencies ++= Seq(
"org.msgpack" % "msgpack-core" % msgpackVersion,
"com.chuusai" %% "shapeless" % shapelessVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test,
"com.dimafeng" %% "testcontainers-scala" % testContainersVersion % Test,
"ch.qos.logback" % "logback-classic" % logbackVersion % Test
),
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")
)
lazy val examples =
project.in(file("examples")).settings(allSettings).settings(noPublish).dependsOn(core)
lazy val benchmarks =
project.in(file("benchmarks")).enablePlugins(JmhPlugin).settings(allSettings).settings(noPublish).dependsOn(core)