forked from zio/zio-schema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
181 lines (163 loc) · 6.27 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
import sbtcrossproject.CrossPlugin.autoImport.crossProject
import BuildHelper.{ crossProjectSettings, _ }
import explicitdeps.ExplicitDepsPlugin.autoImport.unusedCompileDependenciesFilter
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport.scalaJSUseMainModuleInitializer
import sbt.moduleFilter
inThisBuild(
List(
name := "zio-schema",
organization := "dev.zio",
homepage := Some(url("https://github.com/zio/zio-schema")),
developers := List(
Developer(
"ioleo",
"Piotr Gołębiewski",
"ioleo+zio@protonmail.com",
url("https://github.com/ioleo")
),
Developer(
"jczuchnowski",
"Jakub Czuchnowski",
"jakub.czuchnowski@gmail.com",
url("https://github.com/jczuchnowski")
)
),
scmInfo := Some(
ScmInfo(
homepage.value.get,
"scm:git:git@github.com:zio/zio-schema.git"
)
),
licenses := Seq("Apache-2.0" -> url(s"${scmInfo.value.map(_.browseUrl).get}/blob/v${version.value}/LICENSE")),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc")
)
)
ThisBuild / publishTo := sonatypePublishToBundle.value
addCommandAlias("prepare", "fix; fmt")
addCommandAlias("fmt", "all scalafmtSbt scalafmtAll")
addCommandAlias("fmtCheck", "all scalafmtSbtCheck scalafmtCheckAll")
addCommandAlias("fix", "scalafixAll")
addCommandAlias("fixCheck", "scalafixAll --check")
lazy val root = project
.in(file("."))
.settings(
name := "zio-schema",
skip in publish := true,
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
.aggregate(
zioSchemaJVM,
zioSchemaJS,
zioSchemaJsonJVM,
zioSchemaJsonJS,
zioSchemaOpticsJS,
zioSchemaOpticsJVM,
zioSchemaProtobufJS,
zioSchemaProtobufJVM
)
lazy val zioSchema = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-schema"))
.settings(stdSettings("zio-schema"))
.settings(crossProjectSettings)
.settings(buildInfoSettings("zio.schema"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"com.propensive" %% "magnolia" % magnoliaVersion,
"dev.zio" %% "zio-prelude" % zioPreludeVersion,
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided
)
)
lazy val zioSchemaJS = zioSchema.js
.settings(scalaJSUseMainModuleInitializer := true)
lazy val zioSchemaJVM = zioSchema.jvm
.settings(Test / fork := true)
lazy val zioSchemaJson = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-schema-json"))
.dependsOn(zioSchema, zioSchema % "test->test")
.settings(stdSettings("zio-schema-json"))
.settings(crossProjectSettings)
.settings(buildInfoSettings("zio.schema.json"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-json" % zioJsonVersion,
"com.propensive" %% "magnolia" % magnoliaVersion,
"dev.zio" %% "zio-prelude" % zioPreludeVersion,
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided
)
)
lazy val zioSchemaJsonJS = zioSchemaJson.js
.settings(scalaJSUseMainModuleInitializer := true)
lazy val zioSchemaJsonJVM = zioSchemaJson.jvm
lazy val zioSchemaProtobuf = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-schema-protobuf"))
.dependsOn(zioSchema, zioSchema % "test->test")
.settings(stdSettings("zio-schema-protobuf"))
.settings(crossProjectSettings)
.settings(buildInfoSettings("zio.schema.protobuf"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"com.propensive" %% "magnolia" % magnoliaVersion,
"dev.zio" %% "zio-prelude" % zioPreludeVersion,
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided
)
)
lazy val zioSchemaProtobufJS = zioSchemaProtobuf.js
.settings(scalaJSUseMainModuleInitializer := true)
lazy val zioSchemaProtobufJVM = zioSchemaProtobuf.jvm
.settings(Test / fork := true)
lazy val zioSchemaOptics = crossProject(JSPlatform, JVMPlatform)
.in(file("zio-schema-optics"))
.dependsOn(zioSchema, zioSchema % "test->test")
.settings(stdSettings("zio-schema-optics"))
.settings(crossProjectSettings)
.settings(buildInfoSettings("zio.schema.optics"))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-optics" % zioOpticsVersion,
"com.propensive" %% "magnolia" % magnoliaVersion,
"dev.zio" %% "zio-prelude" % zioPreludeVersion,
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided
)
)
lazy val zioSchemaOpticsJS = zioSchemaOptics.js
.settings(scalaJSUseMainModuleInitializer := true)
lazy val zioSchemaOpticsJVM = zioSchemaOptics.jvm
lazy val docs = project
.in(file("zio-schema-docs"))
.settings(
skip.in(publish) := true,
mdocVariables := Map(
"SNAPSHOT_VERSION" -> version.value,
"RELEASE_VERSION" -> previousStableVersion.value.getOrElse("can't find release"),
"ORG" -> organization.value,
"NAME" -> (zioSchemaJVM / name).value,
"CROSS_VERSIONS" -> (zioSchemaJVM / crossScalaVersions).value.mkString(", ")
),
moduleName := "zio-schema-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion
),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(root),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
docusaurusCreateSite := docusaurusCreateSite.dependsOn(Compile / unidoc).value,
docusaurusPublishGhpages := docusaurusPublishGhpages.dependsOn(Compile / unidoc).value
)
.dependsOn(root)
.enablePlugins(MdocPlugin, DocusaurusPlugin, ScalaUnidocPlugin)
lazy val benchmarks = project
.in(file("benchmarks"))
.dependsOn(zioSchemaJVM)
.enablePlugins(JmhPlugin)