-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathbuild.sbt
113 lines (101 loc) · 4.74 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
import Dependencies._
import com.typesafe.tools.mima.core._
import sbt.internal.ProjectMatrix
val scala212 = "2.12.19"
val scala213 = "2.13.14"
val scala3 = "3.3.3"
ThisBuild / version := "0.13.0-SNAPSHOT"
ThisBuild / scalaVersion := scala212
lazy val allScalaVersions = Seq(scala212, scala213, scala3)
lazy val root = (project in file("."))
.aggregate(core.projectRefs ++
supportSpray.projectRefs ++
supportScalaJson.projectRefs ++
supportMsgpack.projectRefs ++
supportMurmurhash.projectRefs: _*)
.settings(
name := "sjson new",
publish / skip := true,
crossScalaVersions := Nil,
mimaPreviousArtifacts := Set.empty,
)
val mimaSettings = Def settings (
mimaPreviousArtifacts := Set.empty,
)
lazy val core = (projectMatrix in file("core"))
.enablePlugins(BoilerplatePlugin)
.settings(
name := "sjson new core",
scalacOptions ++= Seq("-Xfuture", "-feature", "-language:_", "-unchecked", "-deprecation", "-encoding", "utf8"),
mimaSettings,
mimaBinaryIssueFilters ++= Seq(
// private[this] final val
ProblemFilters.exclude[ReversedMissingMethodProblem]("sjsonnew.JavaExtraFormats.sjsonnew$JavaExtraFormats$$FileScheme")
)
)
.jvmPlatform(scalaVersions = allScalaVersions, settings = Seq(
libraryDependencies ++= testDependencies.value ++ Seq(zeroAllocationHashing),
))
def support(n: String) =
ProjectMatrix(id = n, base = file(s"support/$n"))
.dependsOn(core)
.settings(
name := s"sjson-new-$n",
scalacOptions ++= Seq("-Xfuture", "-feature", "-language:_", "-unchecked", "-deprecation", "-encoding", "utf8"),
mimaSettings,
)
lazy val supportSpray = support("spray")
.jvmPlatform(scalaVersions = allScalaVersions, settings = Seq(
libraryDependencies ++= testDependencies.value ++ Seq(sprayJson),
))
lazy val supportScalaJson = support("scalajson")
.settings(
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[IncompatibleMethTypeProblem]("sjsonnew.support.scalajson.unsafe.CompactPrinter.*"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("sjsonnew.support.scalajson.unsafe.JsonPrinter.*"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("sjsonnew.support.scalajson.unsafe.PrettyPrinter.*"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("sjsonnew.support.scalajson.unsafe.CompactPrinter.*"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("sjsonnew.support.scalajson.unsafe.JsonPrinter.*"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("sjsonnew.support.scalajson.unsafe.PrettyPrinter.*"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("sjsonnew.support.scalajson.unsafe.Parser.async"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("sjsonnew.support.scalajson.unsafe.Parser.facade"),
ProblemFilters.exclude[MissingTypesProblem]("sjsonnew.support.scalajson.unsafe.Parser$"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("sjsonnew.support.scalajson.unsafe.Parser.async"),
)
)
.jvmPlatform(scalaVersions = allScalaVersions, settings = Seq(
libraryDependencies ++= testDependencies.value ++ Seq(scalaJson, shadedJawnParser),
))
lazy val supportMsgpack = support("msgpack")
.jvmPlatform(scalaVersions = allScalaVersions, settings = Seq(
libraryDependencies ++= testDependencies.value ++ Seq(msgpackCore),
))
lazy val supportMurmurhash = support("murmurhash")
.jvmPlatform(scalaVersions = allScalaVersions, settings = Seq(
libraryDependencies ++= testDependencies.value,
))
lazy val benchmark = (projectMatrix in file("benchmark"))
.dependsOn(supportSpray, supportScalaJson, supportMsgpack)
.enablePlugins(JmhPlugin)
.settings(
libraryDependencies ++= Seq(jawnSpray, lmIvy),
Jmh / run / javaOptions ++= Seq("-Xmx1G", "-Dfile.encoding=UTF8"),
publish / skip := true,
)
.jvmPlatform(scalaVersions = Seq(scala212))
ThisBuild / organization := "com.eed3si9n"
ThisBuild / organizationName := "eed3si9n"
ThisBuild / organizationHomepage := Some(url("http://eed3si9n.com/"))
ThisBuild / homepage := scmInfo.value map (_.browseUrl)
ThisBuild / scmInfo := Some(ScmInfo(url("https://github.com/eed3si9n/sjson-new"), "git@github.com:eed3si9n/sjson-new.git"))
ThisBuild / developers := List(
Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("https://github.com/eed3si9n"))
)
ThisBuild / description := "A Scala library for JSON (de)serialization"
ThisBuild / licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / 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")
}
ThisBuild / testFrameworks += new TestFramework("verify.runner.Framework")