-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
126 lines (102 loc) · 3.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
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
import scala.Ordering.Implicits.*
import org.typelevel.sbt.gha.JavaSpec.Distribution.Temurin
import org.typelevel.sbt.gha.RefPredicate
import org.typelevel.scalacoptions.*
import org.typelevel.scalacoptions.ScalaVersion.*
import sbtcrossproject.CrossProject
import sbtcrossproject.CrossType
import sbtcrossproject.Platform
name := "classy-optics"
ThisBuild / tlBaseVersion := "0.2"
ThisBuild / organization := "io.github.pismute"
ThisBuild / organizationName := "pismute"
ThisBuild / startYear := Some(2023)
ThisBuild / homepage := Some(url("https://github.com/pismute/classy-optics"))
ThisBuild / licenses := Seq(License.MIT)
ThisBuild / developers := List(
Developer(
"pismute",
"Changwoo Park",
"pismute@gmail.com",
url("https://github.com/pismute")
)
)
val Scala3 = "3.4.2"
ThisBuild / crossScalaVersions := Seq(Scala3)
ThisBuild / scalaVersion := Scala3 // the default Scala
ThisBuild / versionScheme := Some("early-semver")
def fixScalcOptions(opts: Set[ScalacOption]): Set[ScalacOption] = {
opts.map { opt =>
if (opt != ScalacOptions.privateKindProjector) opt
else ScalacOptions.privateOption("kind-projector:underscores", _ >= V3_0_0)
}
}
val devScalacOptions = Set(
ScalacOptions.advancedOption("check-macros", _ >= V3_0_0)
)
ThisBuild / testFrameworks += new TestFramework("munit.Framework")
def myCrossProject(name: String): CrossProject =
CrossProject(name, file(name.replace("classy-", "")))(JVMPlatform, JSPlatform)
.crossType(CrossType.Full)
.settings(
tpolecatScalacOptions ~= fixScalcOptions,
tpolecatDevModeOptions ++= devScalacOptions
)
val mtl = myCrossProject("classy-mtl")
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-mtl" % "1.4.0",
"org.scalameta" %% "munit" % "1.0.0-M11" % Test,
"org.scalameta" %% "munit-scalacheck" % "1.0.0-M11" % Test,
"org.typelevel" %% "cats-laws" % "2.12.0" % Test,
"org.typelevel" %% "cats-mtl-laws" % "1.4.0" % Test,
"org.typelevel" %% "discipline-munit" % "1.0.9" % Test,
"org.typelevel" %% "kittens" % "3.3.0" % Test
)
)
val effect = myCrossProject("classy-effect")
.dependsOn(mtl % s"$Compile->$Compile;$Test->$Test")
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-effect" % "3.5.4",
"org.typelevel" %% "cats-effect-testkit" % "3.5.4" % Test,
"org.typelevel" %% "munit-cats-effect-3" % "1.0.7" % Test,
"org.typelevel" %% "scalacheck-effect-munit" % "2.0-9366e44" % Test
)
)
val root = tlCrossRootProject
.aggregate(mtl, effect)
ThisBuild / tlCiDocCheck := false
ThisBuild / tlCiScalafmtCheck := true
ThisBuild / githubWorkflowPublishTargetBranches := Seq(
RefPredicate.Equals(Ref.Branch("master")),
RefPredicate.StartsWith(Ref.Tag("v"))
)
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec(Temurin, "11"))
ThisBuild / githubWorkflowTargetBranches := Seq("master")
ThisBuild / githubWorkflowTargetTags := Seq("v*")
val scalaSteward = "pismute-steward[bot]"
ThisBuild / mergifyStewardConfig := Some(
MergifyStewardConfig(
author = scalaSteward,
mergeMinors = true,
action = MergifyAction.Merge(Some("squash"))
)
)
ThisBuild / mergifyPrRules += {
val authorCondition = MergifyCondition.Custom("author=pismute-steward[bot]")
MergifyPrRule(
"label scala-steward's PRs",
List(authorCondition),
List(MergifyAction.Label(List("dependency-update")))
)
}
def addCommandsAlias(name: String, cmds: Seq[String]) =
addCommandAlias(name, cmds.mkString(";", ";", ""))
addCommandsAlias(
"fmt",
Seq(
"scalafmtAll",
"scalafmtSbt"
)
)