-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sbt
More file actions
164 lines (151 loc) · 4.81 KB
/
build.sbt
File metadata and controls
164 lines (151 loc) · 4.81 KB
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
val compilerOptions = Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-unchecked",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen"
)
lazy val `monix-circe` = project.in(file("."))
.settings(commonSettings, releaseSettings, skipOnPublishSettings)
.aggregate(core)
lazy val core = project.in(file("core"))
.settings(commonSettings, releaseSettings)
.settings(
name := "monix-circe"
)
lazy val contributors = Seq(
"Avasil" -> "Piotr Gawrys"
)
val jawnVersion = "1.0.0"
val monixVersion = "3.2.2"
val circeVersion = "0.13.0"
val minitestVersion = "2.7.0"
val betterMonadicForVersion = "0.3.0"
def priorTo2_13(scalaVersion: String): Boolean =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) if minor < 13 => true
case _ => false
}
// General Settings
lazy val commonSettings = Seq(
organization := "io.monix",
scalaVersion := "2.13.1",
crossScalaVersions := Seq("2.12.10", "2.13.1"),
scalacOptions ++= compilerOptions,
scalacOptions ++= (
if (priorTo2_13(scalaVersion.value))
Seq(
"-Xfuture",
"-Yno-adapted-args",
"-Ywarn-unused-import"
)
else
Seq(
"-Ywarn-unused:imports"
)
),
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.11.0" cross CrossVersion.full),
addCompilerPlugin("com.olegpy" %% "better-monadic-for" % betterMonadicForVersion),
testFrameworks := Seq(new TestFramework("minitest.runner.Framework")),
libraryDependencies ++= Seq(
"io.monix" %% "monix-reactive" % monixVersion,
"io.circe" %% "circe-jawn" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion % Test,
"io.circe" %% "circe-testing" % circeVersion % Test,
"org.typelevel" %% "jawn-parser" % jawnVersion,
"io.monix" %% "minitest" % minitestVersion % Test,
"io.monix" %% "minitest-laws" % minitestVersion % Test
)
)
lazy val releaseSettings = {
import ReleaseTransformations._
Seq(
releaseCrossBuild := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
// For non cross-build projects, use releaseStepCommand("publishSigned")
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommand("sonatypeReleaseAll"),
pushChanges
),
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
credentials ++= (
for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield
Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)
).toSeq,
publishArtifact in Test := false,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
scmInfo := Some(
ScmInfo(
url("https://github.com/monix/monix-circe"),
"git@github.com:monix/monix-circe.git"
)
),
homepage := Some(url("https://github.com/monix/monix-circe")),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
publishMavenStyle := true,
pomIncludeRepository := { _ =>
false
},
pomExtra := {
<developers>
{for ((username, name) <- contributors) yield
<developer>
<id>{username}</id>
<name>{name}</name>
<url>http://github.com/{username}</url>
</developer>
}
</developers>
},
headerLicense := Some(HeaderLicense.Custom(
"""|Copyright (c) 2019-2019 by The Monix Project Developers.
|See the project homepage at: https://monix.io
|
|Licensed under the Apache License, Version 2.0 (the "License");
|you may not use this file except in compliance with the License.
|You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
|Unless required by applicable law or agreed to in writing, software
|distributed under the License is distributed on an "AS IS" BASIS,
|WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|See the License for the specific language governing permissions and
|limitations under the License."""
.stripMargin)),
)
}
lazy val skipOnPublishSettings = Seq(
skip in publish := true,
publish := (()),
publishLocal := (()),
publishArtifact := false,
publishTo := None
)