forked from circe/circe-yaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
117 lines (110 loc) · 3.82 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
organization in ThisBuild := "io.circe"
val compilerOptions = Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-unchecked",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture"
)
val Versions = new {
val circe = "0.11.1"
val discipline = "0.10.0"
val scalaCheck = "1.14.0"
val scalaTest = "3.0.6-SNAP5"
val snakeYaml = "1.24"
val previousCirceYaml = "0.9.0"
}
val docMappingsApiDir = settingKey[String]("Subdirectory in site target directory for API docs")
val root = project.in(file("."))
.enablePlugins(GhpagesPlugin)
.settings(
name := "circe-yaml",
description := "Library for converting between SnakeYAML's AST and circe's AST",
scalacOptions ++= compilerOptions,
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq(
"-Yno-adapted-args",
"-Ywarn-unused-import",
)
case _ =>
Seq(
"-Ywarn-unused:imports",
)
}
},
scalacOptions in (Compile, console) ~= {
_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports"))
},
scalacOptions in (Test, console) ~= {
_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports"))
},
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % Versions.circe,
"io.circe" %% "circe-jawn" % Versions.circe % Test,
"org.yaml" % "snakeyaml" % Versions.snakeYaml,
"io.circe" %% "circe-testing" % Versions.circe % Test,
"org.typelevel" %% "discipline" % Versions.discipline % Test,
"org.scalacheck" %% "scalacheck" % Versions.scalaCheck % Test,
"org.scalatest" %% "scalatest" % Versions.scalaTest % Test
),
mimaPreviousArtifacts := Set("io.circe" %% "circe-yaml" % Versions.previousCirceYaml)
)
.settings(publishSettings ++ docSettings)
lazy val docSettings = Seq(
autoAPIMappings := true,
apiURL := Some(url("https://circe.github.io/circe-yaml/api/")),
git.remoteRepo := "[email protected]:circe/circe-yaml.git",
docMappingsApiDir := "api",
addMappingsToSiteDir(mappings in (Compile, packageDoc), docMappingsApiDir),
ghpagesNoJekyll := true,
scalacOptions in (Compile, doc) ++= Seq(
"-groups",
"-implicits",
"-doc-source-url", scmInfo.value.get.browseUrl + "/tree/master€{FILE_PATH}.scala",
"-sourcepath", baseDirectory.in(LocalRootProject).value.getAbsolutePath
)
)
lazy val publishSettings = Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
homepage := Some(url("https://github.com/circe/circe-yaml")),
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
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")
},
scmInfo := Some(
ScmInfo(
url("https://github.com/circe/circe-yaml"),
"scm:git:[email protected]:circe/circe-yaml.git"
)
),
developers := List(
Developer("jeremyrsmith", "Jeremy Smith", "[email protected]", url("https://github.com/jeremyrsmith")),
Developer("jeffmay", "Jeff May", "[email protected]", url("https://github.com/jeffmay")),
Developer("travisbrown", "Travis Brown", "[email protected]", url("https://twitter.com/travisbrown"))
)
)
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