-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
93 lines (82 loc) · 2.72 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
ThisBuild / scalaVersion := "3.3.4"
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v")))
ThisBuild / githubWorkflowBuildPostamble ++= Seq(
WorkflowStep.Sbt(List("docs/mdoc"), name = Some("Generate documentation"))
)
ThisBuild / githubWorkflowJavaVersions := Seq(
JavaSpec.temurin("11"),
JavaSpec.temurin("21")
)
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)
lazy val `union-derivation` = project
.in(file("."))
.settings(commonSettings)
.settings(noPublishSettings)
.aggregate(core.jvm, core.native, core.js, examples.jvm, examples.native, examples.js)
lazy val core = crossProject(JVMPlatform, NativePlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("modules/core"))
.settings(commonSettings)
.settings(
name := "union-derivation-core",
libraryDependencies += "org.scalameta" %%% "munit" % "1.0.3" % Test
)
lazy val examples = crossProject(JVMPlatform, NativePlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("modules/examples"))
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
name := "union-derivation-examples"
)
.dependsOn(core)
lazy val docs = project
.in(file("modules/docs"))
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
name := "union-derivation-docs",
scalacOptions -= "-Xfatal-warnings",
mdocIn := baseDirectory.value / "src" / "main" / "mdoc" / "index.md",
mdocOut := file("README.md"),
mdocVariables := Map(
"VERSION" -> version.value.replaceFirst("\\+.*", ""),
"SCALA_VERSION" -> scalaVersion.value
)
)
.dependsOn(core.jvm)
lazy val commonSettings = Seq(
scalacOptions ++= Seq(
"-source:future",
"-no-indent", // let's be conservative for a while
"-old-syntax",
"-Yretain-trees"
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
publish / skip := true
)
inThisBuild(
Seq(
organization := "io.github.irevive",
homepage := Some(url("https://github.com/iRevive/union-derivation")),
licenses := List(License.MIT),
developers := List(Developer("iRevive", "Maksym Ochenashko", "", url("https://github.com/iRevive")))
)
)