-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
89 lines (82 loc) · 3.66 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
import commandmatrix.extra._
import Settings._
Global / excludeLintKeys ++= Set(doc, ideSkipProject, scalacOptions)
ThisProject / versionScheme := Some("early-semver")
val testCasesVersion = "0.2.2"
// IDEs don't like projects which share sources
val ideScala = scala2_13version
val only1JvmScalaInIde =
MatrixAction.ForPlatforms(VirtualAxis.jvm).Configure(_.settings(ideSkipProject := (scalaVersion.value != ideScala)))
val noJsNoNativeInIde =
MatrixAction.ForPlatforms(VirtualAxis.js, VirtualAxis.native).Configure(_.settings(ideSkipProject := true))
val pipez = projectMatrix
.in(file("pipez"))
.someVariations(
List(scala2_13version, scala3version),
List(VirtualAxis.jvm, VirtualAxis.js, VirtualAxis.native)
)(only1JvmScalaInIde, noJsNoNativeInIde)
.enablePlugins(GitVersioning)
.disablePlugins(WelcomePlugin)
.settings(name := "pipez")
.settings(commonSettings: _*)
.settings(excludePackageInDocs("pipez.internal"): _*)
.settings(
libraryDependencies ++= Seq(
("com.kubuszok" %%% "pipez-testcases" % testCasesVersion).cross(CrossVersion.for3Use2_13) % Test,
("com.kubuszok" %%% "pipez-testcases-scala3" % testCasesVersion).cross(CrossVersion.for2_13Use3) % Test
)
)
.settings(publishSettings: _*)
val pipezDsl = projectMatrix
.in(file("pipez-dsl"))
.someVariations(
List(scala2_13version, scala3version),
List(VirtualAxis.jvm, VirtualAxis.js, VirtualAxis.native)
)(only1JvmScalaInIde, noJsNoNativeInIde)
.enablePlugins(GitVersioning)
.disablePlugins(WelcomePlugin)
.settings(name := "pipez-dsl")
.settings(commonSettings: _*)
.settings(excludePackageInDocs("pipez.dsl.internal"): _*)
.settings(
libraryDependencies ++= Seq(
("com.kubuszok" %%% "pipez-testcases" % testCasesVersion).cross(CrossVersion.for3Use2_13) % Test,
("com.kubuszok" %%% "pipez-testcases-scala3" % testCasesVersion).cross(CrossVersion.for2_13Use3) % Test
)
)
.settings(publishSettings: _*)
.dependsOn(pipez)
val root = project
.in(file("."))
.enablePlugins(GitVersioning, WelcomePlugin)
.settings(
name := "pipez-build",
logo :=
s"""Pipez ${version.value} build for ($scala2_13version, $scala3version) x (Scala JVM, Scala.js $scalaJSVersion, Scala Native $nativeVersion)
|
|This build uses sbt-projectmatrix with sbt-commandmatrix helper:
| - Scala JVM adds no suffix to a project name seen in build.sbt
| - Scala.js adds the "JS" suffix to a project name seen in build.sbt
| - Scala Native adds the "Native" suffix to a project name seen in build.sbt
| - Scala 2.13 adds no suffix to a project name seen in build.sbt
| - Scala 3 adds the suffix "3" to a project name seen in build.sbt
|
|When working with IntelliJ, edit "val ideScala = ..." in build.sbt to control which Scala version you're currently working with.""".stripMargin,
usefulTasks := Seq(
sbtwelcome.UsefulTask("listAll", "projects", "List all projects generated by the build matrix"),
sbtwelcome.UsefulTask("testAll", "test", "Compile and test all projects in all Scala versions and platforms"),
sbtwelcome.UsefulTask("stageRelease",
"publishSigned",
"Stage all versions for publishing (assuming you have sbt-sonatype as a global plugin)"
),
sbtwelcome.UsefulTask(
"publishRelease",
"sonatypeBundleRelease",
"Publish all artifacts staged for release (assuming you have sbt-sonatype as a global plugin)"
)
)
)
.settings(commonSettings: _*)
.settings(publishSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(pipez.projectRefs ++ pipezDsl.projectRefs: _*)