-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.sbt
137 lines (125 loc) · 4.18 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
import com.typesafe.tools.mima.core.ReversedMissingMethodProblem
import com.typesafe.tools.mima.core.ProblemFilters
Global / onChangedBuildSource := ReloadOnSourceChanges
ThisBuild / baseVersion := "0.3.0"
ThisBuild / organization := "org.systemfw"
ThisBuild / publishGithubUser := "SystemFw"
ThisBuild / publishFullName := "Fabio Labella"
ThisBuild / homepage := Some(url("https://github.com/SystemFw/dynosaur"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/SystemFw/dynosaur"),
"[email protected]:SystemFw/dynosaur.git"
)
)
ThisBuild / startYear := Some(2020)
Global / excludeLintKeys += scmInfo
val Scala213 = "2.13.10"
val scala3 = "3.3.1"
ThisBuild / spiewakMainBranches := Seq("main")
ThisBuild / crossScalaVersions := Seq(Scala213, scala3, "2.12.14")
ThisBuild / versionIntroduced := Map("3.0.0" -> "0.3.0")
ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head
ThisBuild / initialCommands := """
|import cats._, data._, syntax.all._
|import dynosaur._
""".stripMargin
lazy val root = project
.in(file("."))
.enablePlugins(NoPublishPlugin, SonatypeCiReleasePlugin)
.aggregate(core.js, core.jvm, benchmark)
lazy val core = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Full)
.in(file("modules/core"))
.settings(
name := "dynosaur-core",
scalafmtOnCompile := true,
libraryDependencies ++= List(
"org.typelevel" %%% "cats-core" % "2.10.0",
"org.typelevel" %%% "cats-free" % "2.10.0",
"org.typelevel" %%% "alleycats-core" % "2.10.0",
"org.typelevel" %%% "paiges-core" % "0.4.3",
"org.typelevel" %%% "paiges-cats" % "0.4.3",
"org.scodec" %%% "scodec-bits" % "1.1.38",
"org.scalameta" %%% "munit" % "0.7.29" % Test,
"org.scalameta" %%% "munit-scalacheck" % "0.7.29" % Test
),
mimaBinaryIssueFilters ++= List(
ProblemFilters.exclude[ReversedMissingMethodProblem](
"dynosaur.Schema.dynosaur$Schema$$read_"
),
ProblemFilters.exclude[ReversedMissingMethodProblem](
"dynosaur.Schema.dynosaur$Schema$$read__="
),
ProblemFilters.exclude[ReversedMissingMethodProblem](
"dynosaur.Schema.dynosaur$Schema$$write_"
),
ProblemFilters.exclude[ReversedMissingMethodProblem](
"dynosaur.Schema.dynosaur$Schema$$write__="
)
)
)
.jvmSettings(
libraryDependencies ++= Seq(
"software.amazon.awssdk" % "dynamodb" % "2.21.14"
)
)
lazy val coreJS = core.js
lazy val coreJVM = core.jvm
lazy val benchmark = project
.in(file("modules/benchmark"))
.dependsOn(core.jvm)
.enablePlugins(JmhPlugin)
.disablePlugins(MimaPlugin)
lazy val jsdocs = project
.dependsOn(core.js)
.settings(
githubWorkflowArtifactUpload := false,
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.3.0"
)
.enablePlugins(ScalaJSPlugin)
lazy val docs = project
.in(file("mdoc"))
.settings(
mdocJS := Some(jsdocs),
mdocIn := file("docs"),
mdocOut := file("target/website"),
mdocVariables := Map(
"version" -> version.value,
"scalaVersions" -> crossScalaVersions.value
.map(v => s"- **$v**")
.mkString("\n")
),
githubWorkflowArtifactUpload := false,
fatalWarningsInCI := false
)
.dependsOn(core.jvm)
.enablePlugins(MdocPlugin, NoPublishPlugin)
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11"))
ThisBuild / githubWorkflowBuildPostamble ++= List(
WorkflowStep.Sbt(
List("docs/mdoc"),
cond = Some(s"matrix.scala == '$Scala213'")
)
)
ThisBuild / githubWorkflowAddedJobs += WorkflowJob(
id = "docs",
name = "Deploy docs",
needs = List("publish"),
cond = """
| always() &&
| needs.build.result == 'success' &&
| (needs.publish.result == 'success' || github.ref == 'refs/heads/docs-deploy')
""".stripMargin.trim.linesIterator.mkString.some,
steps = githubWorkflowGeneratedDownloadSteps.value.toList :+
WorkflowStep.Use(
UseRef.Public("peaceiris", "actions-gh-pages", "v3"),
name = Some(s"Deploy docs"),
params = Map(
"publish_dir" -> "./target/website",
"github_token" -> "${{ secrets.GITHUB_TOKEN }}"
)
),
scalas = List(Scala213),
javas = githubWorkflowJavaVersions.value.toList
)