forked from typelevel/jawn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
159 lines (132 loc) · 4.56 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
import ReleaseTransformations._
lazy val previousJawnVersion = "0.14.0"
lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.10"
lazy val scala213 = "2.13.1"
ThisBuild / scalaVersion := scala212
ThisBuild / organization := "org.typelevel"
ThisBuild / licenses += ("MIT", url("http://opensource.org/licenses/MIT"))
ThisBuild / homepage := Some(url("http://github.com/typelevel/jawn"))
ThisBuild / scmInfo := Some(ScmInfo(
browseUrl = url("https://github.com/typelevel/jawn"),
connection = "scm:git:[email protected]:typelevel/jawn.git"
))
ThisBuild / developers += Developer(
name = "Erik Osheim",
email = "[email protected]",
id = "d_m",
url = url("http://github.com/non/")
)
lazy val benchmarkVersion =
scala212
lazy val jawnSettings = Seq(
crossScalaVersions := Seq(scala211, scala212, scala213),
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % previousJawnVersion),
resolvers += Resolver.sonatypeRepo("releases"),
Test / fork := true,
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "1"),
libraryDependencies ++=
"org.scalacheck" %% "scalacheck" % "1.14.2" % Test ::
"org.typelevel" %% "claimant" % "0.1.2" % Test ::
Nil,
scalacOptions ++=
"-deprecation" ::
"-encoding" :: "utf-8" ::
"-feature" ::
"-unchecked" ::
Nil,
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 12 =>
Seq("-Xfatal-warnings", "-Xfuture")
case _ =>
Nil
}
},
scalacOptions += {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, v)) if v <= 11 =>
"-optimize"
case _ =>
"-opt:l:method"
}
},
// release stuff
releaseCrossBuild := true,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := Function.const(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")
}
},
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommandAndRemaining("+test"), // formerly runTest
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
setNextVersion,
commitNextVersion,
releaseStepCommandAndRemaining("sonatypeReleaseAll"),
pushChanges))
lazy val noPublish = Seq(
publish / skip := true,
mimaPreviousArtifacts := Set())
lazy val root = project.in(file("."))
.aggregate(all.map(Project.projectToRef): _*)
.disablePlugins(JmhPlugin)
.settings(name := "jawn")
.settings(jawnSettings: _*)
.settings(crossScalaVersions := List())
.settings(noPublish: _*)
lazy val parser = project.in(file("parser"))
.settings(name := "parser")
.settings(moduleName := "jawn-parser")
.settings(jawnSettings: _*)
.disablePlugins(JmhPlugin)
lazy val util = project.in(file("util"))
.dependsOn(parser % "compile->compile;test->test")
.settings(name := "util")
.settings(moduleName := "jawn-util")
.settings(jawnSettings: _*)
.disablePlugins(JmhPlugin)
lazy val ast = project.in(file("ast"))
.dependsOn(parser % "compile->compile;test->test")
.dependsOn(util % "compile->compile;test->test")
.settings(name := "ast")
.settings(moduleName := "jawn-ast")
.settings(jawnSettings: _*)
.disablePlugins(JmhPlugin)
def support(s: String) =
Project(id = s, base = file(s"support/$s"))
.settings(name := (s + "-support"))
.settings(moduleName := "jawn-" + s)
.dependsOn(parser)
.settings(jawnSettings: _*)
.disablePlugins(JmhPlugin)
lazy val supportJson4s = support("json4s")
.dependsOn(util)
.settings(libraryDependencies += "org.json4s" %% "json4s-ast" % "3.6.7")
lazy val supportPlay = support("play")
.settings(libraryDependencies += "com.typesafe.play" %% "play-json" % "2.7.4")
lazy val supportSpray = support("spray")
.settings(crossScalaVersions := Seq(scala211, scala212))
.settings(libraryDependencies += "io.spray" %% "spray-json" % "1.3.5")
lazy val benchmark = project.in(file("benchmark"))
.dependsOn(all.map(Project.classpathDependency[Project]): _*)
.settings(name := "jawn-benchmark")
.settings(jawnSettings: _*)
.settings(scalaVersion := benchmarkVersion)
.settings(crossScalaVersions := Seq(benchmarkVersion))
.settings(noPublish: _*)
.enablePlugins(JmhPlugin)
lazy val all =
Seq(parser, util, ast, supportJson4s, supportPlay, supportSpray)