-
Notifications
You must be signed in to change notification settings - Fork 58
/
build.sbt
153 lines (133 loc) · 8.07 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
import com.typesafe.tools.mima.core._
addCommandAlias("fmt", "; compile:scalafmt; test:scalafmt; scalafmtSbt")
addCommandAlias("fmtCheck", "; compile:scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck")
ThisBuild / tlBaseVersion := "1.2"
ThisBuild / organization := "org.scodec"
ThisBuild / organizationName := "Scodec"
ThisBuild / startYear := Some(2013)
ThisBuild / crossScalaVersions := Seq("2.12.20", "2.13.15", "3.3.4")
ThisBuild / tlVersionIntroduced := Map(
"3" -> "1.1.27",
"2.13" -> "1.1.12",
"2.12" -> "1.1.2"
)
ThisBuild / tlMimaPreviousVersions ~= (_.filterNot(_ == "1.1.32"))
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"))
ThisBuild / tlFatalWarnings := false
ThisBuild / scmInfo := Some(
ScmInfo(url("https://github.com/scodec/scodec-bits"), "[email protected]:scodec/scodec-bits.git")
)
ThisBuild / licenses := List(
("BSD-3-Clause", url("https://github.com/scodec/scodec-bits/blob/main/LICENSE"))
)
ThisBuild / developers ++= List(
tlGitHubDev("mpilquist", "Michael Pilquist"),
tlGitHubDev("pchiusano", "Paul Chiusano")
)
ThisBuild / tlSonatypeUseLegacyHost := true
ThisBuild / mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scodec.bits.ByteVector.grouped"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.ByteVector$GroupedOp"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.ByteVector$GroupedOp$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.GroupedOp"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector$GroupedOp"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scodec.bits.BitVector.grouped"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.BitVector$GroupedOp"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.BitVector$GroupedOp$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.GroupedOp"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector$GroupedOp"),
ProblemFilters.exclude[IncompatibleTemplateDefProblem]("scodec.bits.ScalaVersionSpecific"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.ScalaVersionSpecific$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.package.EitherOps"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.package$EitherOps"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.package$EitherOps$"),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"scodec.bits.LiteralSyntaxMacros.hexStringInterpolator"
),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"scodec.bits.LiteralSyntaxMacros.binStringInterpolator"
),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.LiteralSyntaxMacros$blackbox$"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.LiteralSyntaxMacros$blackbox$"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.ScalaVersionSpecific"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("scodec.bits.BitVector.reduceBalanced"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.BuildInfo"),
ProblemFilters.exclude[MissingClassProblem]("scodec.bits.BuildInfo$"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.crc.vectorTable"),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"scodec.bits.ByteVector#ByteVectorInputStream#CustomAtomicInteger.getAndUpdate_"
),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("scodec.bits.HexDumpFormat.render"),
ProblemFilters.exclude[IncompatibleMethTypeProblem]("scodec.bits.HexDumpFormat.print"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.HexDumpFormat.this"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scodec.bits.ByteVector.fromHexInternal"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector#AtEmpty.apply"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("scodec.bits.ByteVector.fromBinInternal"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"scodec.bits.ByteVector.fromBinInternal$default$2"
)
)
lazy val root = tlCrossRootProject.aggregate(core, benchmark)
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
.in(file("core"))
.settings(
name := "scodec-bits",
libraryDependencies ++= {
if (tlIsScala3.value) Nil
else Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided")
},
Compile / unmanagedResources ++= {
val base = baseDirectory.value
(base / "NOTICE") +: (base / "LICENSE") +: ((base / "licenses") * "LICENSE_*").get
},
scalacOptions := scalacOptions.value.filterNot(_ == "-source:3.0-migration"),
libraryDependencies += "org.scalameta" %%% "munit-scalacheck" % "1.0.0" % "test"
)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js.settings(
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind.CommonJSModule)),
// Override JS versions, as older stuff built for SJS 0.6
tlVersionIntroduced := tlVersionIntroduced.value ++ Map(
"2.13" -> "1.1.14",
"2.12" -> "1.1.14"
),
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.deflate"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.deflate$default$1"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.deflate$default$2"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.deflate$default$3"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.deflate$default$4"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.inflate"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.inflate$default$1"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.digest"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.digest"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.encrypt"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.encrypt$default$3"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.decrypt"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.decrypt$default$3"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.deflate"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.deflate$default$1"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.deflate$default$2"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.deflate$default$3"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.deflate$default$4"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.inflate"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.inflate$default$1"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.inflate$default$2"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.digest"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.encrypt"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.encrypt$default$3"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.decrypt"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.decrypt$default$3"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.cipher"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.BitVector.cipher$default$4"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.cipher"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scodec.bits.ByteVector.cipher$default$4")
)
)
lazy val coreNative = core.native.settings(
tlVersionIntroduced ++= List("2.12", "2.13", "3").map(_ -> "1.2.0").toMap
)
lazy val benchmark: Project = project
.in(file("benchmark"))
.dependsOn(coreJVM)
.enablePlugins(JmhPlugin, NoPublishPlugin)