This repository has been archived by the owner on May 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
142 lines (132 loc) · 4.27 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
ThisBuild / organization := "io.circe"
ThisBuild / crossScalaVersions := Seq("2.13.7")
ThisBuild / githubWorkflowPublishTargetBranches := Nil
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Use(
UseRef.Public(
"codecov",
"codecov-action",
"v1"
)
)
)
val compilerOptions = Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-unchecked",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-unused-import",
"-Xfuture"
)
val circeVersion = "0.11.2"
val previousCirceSprayVersion = "0.10.0"
val baseSettings = Seq(
scalacOptions ++= compilerOptions,
Compile / console / scalacOptions ~= {
_.filterNot(Set("-Ywarn-unused-import"))
},
Test / console / scalacOptions ~= {
_.filterNot(Set("-Ywarn-unused-import"))
},
resolvers ++= Seq(
Resolver.sonatypeRepo("releases"),
Resolver.sonatypeRepo("snapshots")
),
coverageHighlighting := true,
(Compile / scalastyleSources) ++= (Compile / unmanagedSourceDirectories).value,
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-jawn" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion % Test,
"io.circe" %% "circe-testing" % circeVersion % Test
),
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.AllLibraryJars
)
val docMappingsApiDir = settingKey[String]("Subdirectory in site target directory for API docs")
val allSettings = baseSettings ++ publishSettings
val root = project.in(file(".")).settings(allSettings ++ noPublishSettings).aggregate(core).dependsOn(core)
lazy val core = project
.in(file("core"))
.enablePlugins(GhpagesPlugin)
.settings(allSettings)
.settings(
moduleName := "circe-spray",
docMappingsApiDir := "api",
addMappingsToSiteDir(Compile / packageDoc / mappings, docMappingsApiDir),
ghpagesNoJekyll := true,
Compile / doc / scalacOptions ++= Seq(
"-groups",
"-implicits",
"-doc-source-url",
scmInfo.value.get.browseUrl + "/tree/master€{FILE_PATH}.scala",
"-sourcepath",
(LocalRootProject / baseDirectory).value.getAbsolutePath
),
git.remoteRepo := "[email protected]:circe/circe-spray.git",
autoAPIMappings := true,
apiURL := Some(url("https://circe.github.io/circe-spray/api/")),
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.3.16",
"io.spray" %% "spray-httpx" % "1.3.4",
"io.spray" %% "spray-routing-shapeless23" % "1.3.4" % Test,
"io.spray" %% "spray-testkit" % "1.3.4" % Test,
"org.scalacheck" %% "scalacheck" % "1.15.2" % Test,
"org.scalatest" %% "scalatest" % "3.2.10" % Test,
"org.scalatestplus" %% "scalacheck-1-15" % "3.2.3.0" % Test,
compilerPlugin(("org.scalamacros" % "paradise" % "2.1.1" % Test).cross(CrossVersion.full))
),
mimaPreviousArtifacts := Set("io.circe" %% "circe-spray" % previousCirceSprayVersion)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
lazy val publishSettings = Seq(
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseVcsSign := true,
homepage := Some(url("https://github.com/circe/circe-spray")),
licenses := Seq("Apache 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
publishMavenStyle := true,
Test / publishArtifact := 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-spray"),
"scm:git:[email protected]:circe/circe-spray.git"
)
),
developers := List(
Developer(
"travisbrown",
"Travis Brown",
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