-
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathbuild.sbt
More file actions
119 lines (99 loc) · 3.5 KB
/
build.sbt
File metadata and controls
119 lines (99 loc) · 3.5 KB
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
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
import Dependencies._
addCommandAlias("fmt", "; scalafmtAll; scalafmtSbt")
addCommandAlias("fmtCheck", "; scalafmtCheckAll; scalafmtSbtCheck")
ThisBuild / baseVersion := "0.1"
ThisBuild / organization := "org.typelevel"
ThisBuild / organizationName := "Typelevel"
ThisBuild / publishGithubUser := "johnynek"
ThisBuild / publishFullName := "P. Oscar Boykin"
ThisBuild / crossScalaVersions := List("0.27.0-RC1", "2.12.12", "2.13.3")
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.Equals(Ref.Branch("main")),
RefPredicate.StartsWith(Ref.Tag("v"))
)
ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("fmtCheck", "test", "mimaReportBinaryIssues"))
)
ThisBuild / githubWorkflowEnv ++= Map(
"SONATYPE_USERNAME" -> s"$${{ secrets.SONATYPE_USERNAME }}",
"SONATYPE_PASSWORD" -> s"$${{ secrets.SONATYPE_PASSWORD }}",
"PGP_SECRET" -> s"$${{ secrets.PGP_SECRET }}"
)
ThisBuild / githubWorkflowTargetTags += "v*"
ThisBuild / githubWorkflowPublishPreamble +=
WorkflowStep.Run(
List("echo $PGP_SECRET | base64 -d | gpg --import"),
name = Some("Import signing key")
)
ThisBuild / githubWorkflowPublish := Seq(WorkflowStep.Sbt(List("release")))
ThisBuild / homepage := Some(url("https://github.com/typelevel/cats-parse"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/typelevel/cats-parse"),
"git@github.com:typelevel/cats-parse.git"
)
)
ThisBuild / licenses := List(("MIT", url("http://opensource.org/licenses/MIT")))
ThisBuild / testFrameworks += new TestFramework("munit.Framework")
lazy val root = project
.in(file("."))
.aggregate(core.jvm, core.js)
.settings(noPublishSettings)
lazy val docs = project
.in(file("cats-parse-docs"))
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.disablePlugins(MimaPlugin)
.settings(noPublishSettings)
.dependsOn(core.jvm)
.settings(
moduleName := "cats-parse-docs",
watchSources += baseDirectory.in(ThisBuild).value / "docs",
mdocVariables := Map(
"VERSION" -> version.value
)
)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.settings(
name := "cats-parse",
libraryDependencies += cats.value
)
.settings(dottyLibrarySettings)
.settings(dottyJsSettings(ThisBuild / crossScalaVersions))
.settings(
libraryDependencies ++=
Seq(
munit.value % Test,
munitScalacheck.value % Test
)
)
.jsSettings(
scalaJSStage in Global := FastOptStage,
parallelExecution := false,
jsEnv := new org.scalajs.jsenv.nodejs.NodeJSEnv(),
// batch mode decreases the amount of memory needed to compile scala.js code
scalaJSLinkerConfig := scalaJSLinkerConfig.value
.withBatchMode(scala.sys.env.get("TRAVIS").isDefined)
.withModuleKind(ModuleKind.CommonJSModule),
coverageEnabled := false,
scalaJSUseMainModuleInitializer := false
)
.jsSettings(crossScalaVersions := crossScalaVersions.value.filterNot(_.startsWith("0.")))
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val bench = project
.enablePlugins(JmhPlugin)
.settings(noPublishSettings)
.settings(
name := "bench",
libraryDependencies ++= Seq(
"com.lihaoyi" %% "fastparse" % "2.3.0",
"org.http4s" %% "parsley" % "1.5.0-M3",
"org.typelevel" %% "jawn-ast" % "1.0.0",
"org.parboiled" %% "parboiled" % "2.2.1",
"org.tpolecat" %% "atto-core" % "0.8.0"
),
githubWorkflowArtifactUpload := false
)
.dependsOn(coreJVM)