-
Notifications
You must be signed in to change notification settings - Fork 116
/
build.sbt
82 lines (75 loc) · 2.56 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
import com.softwaremill.UpdateVersionInDocs
import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings
import com.softwaremill.Publish.{updateDocs, ossPublishSettings}
val scala3 = "3.3.3"
ThisBuild / dynverTagPrefix := "scala3-v" // a custom prefix is needed to differentiate tags between scala2 & scala3 versions
val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
scalaVersion := scala3,
organization := "com.softwaremill.magnolia1_3",
description := "Fast, easy and transparent typeclass derivation for Scala 3",
updateDocs := UpdateVersionInDocs(
sLog.value,
organization.value,
version.value,
List(file("readme.md"))
)
)
lazy val root =
project
.in(file("."))
.settings(commonSettings)
.settings(name := "magnolia-root", publishArtifact := false)
.aggregate(
(core.projectRefs ++ examples.projectRefs ++ test.projectRefs): _*
)
lazy val core = (projectMatrix in file("core"))
.settings(commonSettings)
.settings(
name := "magnolia",
mimaPreviousArtifacts := {
val current = version.value
val isRcOrMilestone = current.contains("M") || current.contains("RC")
if (!isRcOrMilestone) {
val previous = previousStableVersion.value
println(
s"[info] Not a M or RC version, using previous version for MiMa check: $previous"
)
previousStableVersion.value
.map(organization.value %% moduleName.value % _)
.toSet
} else {
println(
s"[info] $current is an M or RC version, no previous version to check with MiMa"
)
Set.empty
}
},
versionScheme := Some("early-semver")
)
.jvmPlatform(scalaVersions = List(scala3))
.jsPlatform(scalaVersions = List(scala3))
.nativePlatform(scalaVersions = List(scala3))
lazy val examples = (projectMatrix in file("examples"))
.dependsOn(core)
.settings(commonSettings)
.settings(
name := "magnolia-examples",
publishArtifact := false
)
.jvmPlatform(scalaVersions = List(scala3))
.jsPlatform(scalaVersions = List(scala3))
.nativePlatform(scalaVersions = List(scala3))
lazy val test = (projectMatrix in file("test"))
.dependsOn(examples)
.settings(commonSettings)
.settings(
name := "magnolia-test",
projectDependencies ++= Seq(
"org.scalameta" %%% "munit" % "1.0.0-M12"
),
testFrameworks += new TestFramework("munit.Framework"),
publishArtifact := false
)
.jvmPlatform(scalaVersions = List(scala3))
.jsPlatform(scalaVersions = List(scala3))
.nativePlatform(scalaVersions = List(scala3))