-
Notifications
You must be signed in to change notification settings - Fork 38
/
build.sbt
153 lines (137 loc) · 4.43 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
import Versions.*
import BuildHelper.*
import zio.sbt.githubactions.Step
enablePlugins(ZioSbtEcosystemPlugin, ZioSbtCiPlugin)
lazy val scala212V = "2.12.19"
lazy val scala213V = "2.13.14"
lazy val scala3V = "3.3.3"
lazy val allScalas = List("2.12", "2.13", "3.3")
inThisBuild(
List(
name := "ZIO Cache",
zioVersion := "2.1.4",
scalaVersion := scala213V,
ciBackgroundJobs := Seq("free --si -tmws 10"),
developers := List(
Developer(
"jdegoes",
"John De Goes",
url("http://degoes.net")
)
),
ciEnabledBranches := Seq("series/2.x"),
ciTargetJavaVersions := List("11", "21"),
ciTargetScalaVersions := Map(
(zioCacheJVM / thisProject).value.id -> allScalas,
(zioCacheJS / thisProject).value.id -> allScalas,
(zioCacheNative / thisProject).value.id -> allScalas
),
versionScheme := Some("early-semver")
)
)
addCommandAlias("benchmark", "benchmarks/Jmh/run")
lazy val root = project
.in(file("."))
.settings(
publish / skip := true,
crossScalaVersions := Seq(),
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)
.aggregate(
zioCacheJVM,
zioCacheJS,
zioCacheNative,
benchmarks,
docs
)
lazy val zioCache = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.in(file("zio-cache"))
.settings(
crossScalaVersions := List(scala212V, scala213V, scala3V),
stdSettings(name = Some("zio-cache"), packageName = Some("zio.cache"), enableCrossProject = true),
silencerSettings,
enableZIO(),
libraryDependencies ++= Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % ScalaCollectionCompatVersion
),
scalacOptions ++= Seq(
"-release",
"11"
),
scalacOptions ++=
(if (scalaBinaryVersion.value == "3")
Seq()
else
Seq(
"-opt:l:method",
"-opt:l:inline",
"-opt-inline-from:scala.**"
))
)
lazy val zioCacheJVM = zioCache.jvm
.settings(
scala3Settings,
scalaReflectTestSettings,
enableMimaSettingsJVM
)
lazy val zioCacheJS = zioCache.js
.settings(
scalaJSUseMainModuleInitializer := true,
enableMimaSettingsJS
)
lazy val zioCacheNative = zioCache.native
.settings(
nativeSettings,
enableMimaSettingsNative
)
lazy val benchmarks = project
.in(file("zio-cache-benchmarks"))
.settings(stdSettings(name = Some("zio-cache-benchmarks"), packageName = Some("zio.cache")))
.settings(
crossScalaVersions := List(scala213V, scala3V),
publish / skip := true
)
.dependsOn(zioCacheJVM)
.enablePlugins(JmhPlugin)
lazy val docs = project
.in(file("zio-cache-docs"))
.settings(
moduleName := "zio-cache-docs",
scalacOptions -= "-Yno-imports",
scalacOptions -= "-Xfatal-warnings",
projectName := (ThisBuild / name).value,
mainModuleName := (zioCacheJVM / moduleName).value,
projectStage := ProjectStage.Development,
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(zioCacheJVM),
crossScalaVersions := List(scala213V),
publish / skip := true
)
.dependsOn(zioCacheJVM)
.enablePlugins(WebsitePlugin)
lazy val enforceMimaCompatibility = true // Enable / disable failing CI on binary incompatibilities
lazy val enableMimaSettingsJVM =
Def.settings(
mimaFailOnProblem := enforceMimaCompatibility,
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %% moduleName.value % _).toSet,
mimaBinaryIssueFilters ++= Seq()
)
lazy val enableMimaSettingsJS =
Def.settings(
mimaFailOnProblem := enforceMimaCompatibility,
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %%% moduleName.value % _).toSet,
mimaBinaryIssueFilters ++= Seq()
)
lazy val enableMimaSettingsNative =
Def.settings(
mimaFailOnProblem := enforceMimaCompatibility,
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %%% moduleName.value % _).toSet,
mimaBinaryIssueFilters ++= Seq()
)
ThisBuild / ciCheckArtifactsBuildSteps +=
Step.SingleStep(
"Check binary compatibility",
run = Some(
"sbt \"+zioCacheJVM/mimaReportBinaryIssues; zioCacheJS/mimaReportBinaryIssues; zioCacheNative/mimaReportBinaryIssues\""
)
)