-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathbuild.sbt
117 lines (106 loc) · 3.64 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
import com.typesafe.tools.mima.core._
import Dependencies._
val scala212 = "2.12.20"
val scala213 = "2.13.16"
val scala3 = "3.3.4"
GlobalScope / tlCommandAliases ++= Map(
"fmt" -> List("scalafmtAll", "scalafmtSbt"),
"fmtCheck" -> List("scalafmtCheckAll", "scalafmtSbtCheck"),
"prePR" -> List("githubWorkflowGenerate", "+fmt", "bench/compile", "+test")
)
ThisBuild / tlBaseVersion := "1.1"
// continue enforcing bincompat with 0.3.x series
ThisBuild / tlMimaPreviousVersions ++= (0 to 10).map(x => s"0.3.$x").toSet
ThisBuild / startYear := Some(2021)
ThisBuild / developers += tlGitHubDev("johnynek", "P. Oscar Boykin")
ThisBuild / crossScalaVersions := List(scala212, scala213, scala3)
ThisBuild / scalaVersion := scala213
ThisBuild / tlVersionIntroduced := Map("3" -> "0.3.4")
ThisBuild / githubWorkflowAddedJobs ++= Seq(
WorkflowJob(
id = "coverage",
name = "Generate coverage report",
scalas = Nil,
sbtStepPreamble = Nil,
steps = List(WorkflowStep.Checkout) ++ WorkflowStep.SetupJava(
githubWorkflowJavaVersions.value.toList
) ++ githubWorkflowGeneratedCacheSteps.value ++ List(
WorkflowStep.Sbt(List("coverage", "rootJVM/test", "coverageAggregate")),
WorkflowStep.Use(
UseRef.Public(
"codecov",
"codecov-action",
"v3"
)
)
)
)
)
ThisBuild / licenses := List(License.MIT)
lazy val root = tlCrossRootProject.aggregate(core, bench)
lazy val docs =
project.in(file("site")).enablePlugins(TypelevelSitePlugin).dependsOn(core.jvm, bench)
lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.crossType(CrossType.Full)
.settings(
name := "cats-parse",
libraryDependencies ++=
Seq(
cats.value,
munit.value % Test,
munitScalacheck.value % Test
),
libraryDependencies ++= {
if (tlIsScala3.value) Nil else Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
},
mimaBinaryIssueFilters ++= {
/*
* It is okay to filter anything in Impl or RadixNode which are private
*/
if (tlIsScala3.value)
List(
ProblemFilters.exclude[DirectMissingMethodProblem]("cats.parse.Parser#Error.fromProduct"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("cats.parse.Parser#Error.unapply"),
ProblemFilters.exclude[MissingTypesProblem]("cats.parse.Parser$Error$"),
ProblemFilters.exclude[IncompatibleResultTypeProblem]("cats.parse.Parser#Error.unapply"),
ProblemFilters.exclude[DirectMissingMethodProblem]("cats.parse.Parser#Error.fromProduct")
)
else Nil
} ++ MimaExclusionRules.parserImpl ++ MimaExclusionRules.bitSetUtil
)
.jvmSettings(
// We test against jawn on JVM for some json parsers
libraryDependencies += jawnAst.value % Test
)
.jsSettings(
coverageEnabled := false
)
.nativeSettings(
// cats-parse 1.0.1 switches to Scala Native 0.5, reset tlVersionIntroduced
tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.0.1").toMap,
coverageEnabled := false
)
lazy val bench = project
.enablePlugins(JmhPlugin, NoPublishPlugin)
.settings(
name := "bench",
coverageEnabled := false,
scalacOptions += "-Wconf:cat=unused-nowarn:s",
Compile / unmanagedSources := {
if (Set("2.12", "2.13").contains(scalaBinaryVersion.value)) {
(Compile / unmanagedSources).value
} else Nil
},
libraryDependencies ++= {
if (Set("2.12", "2.13").contains(scalaBinaryVersion.value))
Seq(
fastParse,
parsley,
jawnAst.value,
parboiled,
attoCore
)
else Nil
}
)
.dependsOn(core.jvm)