@@ -3,16 +3,16 @@ import sbtcrossproject.CrossPlugin.autoImport.crossProject
3
3
import com .typesafe .tools .mima .core ._
4
4
5
5
lazy val V = new {
6
- def munit = " 0.7.29"
6
+ def munit = " 1.0.0-M10"
7
+ def scalacheck = " 1.17.0"
7
8
}
8
9
val scala212 = " 2.12.15"
9
10
val scala213 = " 2.13.8"
10
- val scala3 = " 3.1.3 "
11
+ val scala3 = " 3.3.1 "
11
12
val ScalaVersions = List (scala213, scala212, scala3)
12
13
inThisBuild(
13
14
List (
14
15
useSuperShell := false ,
15
- scalacOptions += " -Yrangepos" ,
16
16
organization := " com.geirsson" ,
17
17
version ~= { old => old.replace('+' , '-' ) },
18
18
licenses := Seq (
@@ -27,7 +27,7 @@ inThisBuild(
27
27
" olafurpg@gmail.com" ,
28
28
url(" https://geirsson.com" )
29
29
),
30
- resolvers += Resolver .sonatypeRepo (" snapshots" ),
30
+ resolvers ++ = Resolver .sonatypeOssRepos (" snapshots" ),
31
31
versionScheme := Some (" early-semver" )
32
32
)
33
33
)
@@ -53,10 +53,16 @@ commands += Command.command("taskready") { s =>
53
53
}
54
54
55
55
lazy val warnUnusedImport = Def .setting {
56
- if (scalaVersion.value.startsWith(" 2.13" )) " -Wunused:imports"
56
+ if (scalaVersion.value.startsWith(" 2.13" ) ||
57
+ scalaVersion.value.startsWith(" 3." )) " -Wunused:imports"
57
58
else " -Ywarn-unused-import"
58
59
}
59
60
61
+ lazy val yRangePos = Def .setting {
62
+ if (scalaVersion.value.startsWith(" 3." )) Seq .empty[String ]
63
+ else Seq (" -Yrangepos" )
64
+ }
65
+
60
66
val languageAgnosticCompatibilityPolicy : ProblemFilter = (problem : Problem ) => {
61
67
val (ref, fullName) = problem match {
62
68
case problem : TemplateProblem => (problem.ref, problem.ref.fullName)
@@ -70,26 +76,30 @@ val languageAgnosticCompatibilityPolicy: ProblemFilter = (problem: Problem) => {
70
76
}
71
77
72
78
lazy val sharedSettings = List [Setting [_]](
73
- scalacOptions ++= List (
74
- " -Yrangepos " ,
79
+ scalacOptions ++= yRangePos.value,
80
+ scalacOptions ++= Seq (
75
81
" -deprecation" ,
76
82
warnUnusedImport.value
77
83
),
78
84
mimaBinaryIssueFilters ++= List [ProblemFilter ](
79
85
languageAgnosticCompatibilityPolicy
80
86
),
81
- mimaPreviousArtifacts := Set (" com.geirsson" %% moduleName.value % " 0.9.10" ),
82
87
crossScalaVersions := ScalaVersions ,
83
88
scalaVersion := scala213
84
89
)
85
90
86
- skip.in(publish) := true
91
+ lazy val mimaSettings = List [Setting [_]](
92
+ mimaPreviousArtifacts := Set (" com.geirsson" %% moduleName.value % " 0.9.10" )
93
+ )
94
+
95
+ publish / skip := true
87
96
disablePlugins(MimaPlugin )
88
97
89
98
lazy val pprint = crossProject(JVMPlatform , JSPlatform , NativePlatform )
90
99
.in(file(" metaconfig-pprint" ))
91
100
.settings(
92
101
sharedSettings,
102
+ mimaSettings,
93
103
moduleName := " metaconfig-pprint" ,
94
104
libraryDependencies += " com.lihaoyi" %%% " fansi" % " 0.4.0" ,
95
105
libraryDependencies ++= {
@@ -101,18 +111,16 @@ lazy val pprint = crossProject(JVMPlatform, JSPlatform, NativePlatform)
101
111
else Nil
102
112
}
103
113
)
104
- .nativeSettings(
105
- crossScalaVersions -= scala3
106
- )
107
114
108
115
lazy val core = crossProject(JVMPlatform , JSPlatform , NativePlatform )
109
116
.in(file(" metaconfig-core" ))
110
117
.settings(
111
118
sharedSettings,
119
+ mimaSettings,
112
120
moduleName := " metaconfig-core" ,
113
121
libraryDependencies ++= List (
114
- " org.typelevel" %%% " paiges-core" % " 0.4.2 " ,
115
- " org.scala-lang.modules" %%% " scala-collection-compat" % " 2.5 .0"
122
+ " org.typelevel" %%% " paiges-core" % " 0.4.3 " ,
123
+ " org.scala-lang.modules" %%% " scala-collection-compat" % " 2.11 .0"
116
124
)
117
125
)
118
126
.settings(
@@ -131,69 +139,56 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
131
139
else Seq .empty
132
140
}
133
141
)
134
- .nativeSettings(
135
- crossScalaVersions -= scala3
136
- )
137
142
.dependsOn(pprint)
138
143
139
- lazy val coreJVM = core.jvm
140
- lazy val coreJS = core.js
141
- lazy val coreNative = core.native
142
-
143
144
lazy val typesafe = project
144
145
.in(file(" metaconfig-typesafe-config" ))
145
146
.settings(
146
147
sharedSettings,
148
+ mimaSettings,
147
149
moduleName := " metaconfig-typesafe-config" ,
148
150
description := " Integration for HOCON using typesafehub/config." ,
149
151
libraryDependencies += " com.typesafe" % " config" % " 1.4.1"
150
152
)
151
- .dependsOn(coreJVM )
153
+ .dependsOn(core.jvm )
152
154
153
155
lazy val sconfig = crossProject(JVMPlatform , JSPlatform , NativePlatform )
154
156
.in(file(" metaconfig-sconfig" ))
155
157
.settings(
156
158
sharedSettings,
159
+ mimaSettings,
157
160
moduleName := " metaconfig-sconfig" ,
158
161
description := " Integration for HOCON using ekrich/sconfig." ,
159
162
libraryDependencies ++= List (
160
- " org.ekrich" %%% " sconfig" % " 1.4.4 "
163
+ " org.ekrich" %%% " sconfig" % " 1.5.1 "
161
164
)
162
165
)
163
- .jsSettings (
166
+ .platformsSettings( JSPlatform , NativePlatform ) (
164
167
libraryDependencies ++= List (
165
- " org.ekrich" %%% " sjavatime" % " 1.1.5 "
168
+ " org.ekrich" %%% " sjavatime" % " 1.1.9 "
166
169
)
167
170
)
168
- .nativeSettings(
169
- libraryDependencies ++= List (
170
- " org.ekrich" %%% " sjavatime" % " 1.1.3"
171
- ),
172
- crossScalaVersions -= scala3
173
- )
174
171
.dependsOn(core)
175
- lazy val sconfigJVM = sconfig.jvm
176
- lazy val sconfigJS = sconfig.js
177
- lazy val sconfigNative = sconfig.native
178
172
179
173
lazy val tests = crossProject(JVMPlatform , JSPlatform , NativePlatform )
180
174
.in(file(" metaconfig-tests" ))
181
175
.disablePlugins(MimaPlugin )
182
176
.settings(
183
177
sharedSettings,
184
- skip in publish := true ,
185
- publishArtifact.in( Compile , packageDoc) := false ,
178
+ publish / skip := true ,
179
+ Compile / packageDoc / publishArtifact := false ,
186
180
testFrameworks := List (new TestFramework (" munit.Framework" )),
187
181
libraryDependencies ++= List (
188
- " org.scalameta" %%% " munit-scalacheck" % V .munit
182
+ " org.scalacheck" %%% " scalacheck" % V .scalacheck,
183
+ " org.scalameta" %%% " munit-scalacheck" % V .munit % Test
189
184
)
190
185
)
191
186
.jsSettings(
192
187
scalaJSLinkerConfig ~= (_.withModuleKind(ModuleKind .CommonJSModule ))
193
188
)
194
189
.jvmSettings(
195
- mainClass in GraalVMNativeImage := Some (" metaconfig.tests.ExampleMain" ),
196
- sources.in( Compile , doc) := Seq .empty,
190
+ GraalVMNativeImage / mainClass := Some (" metaconfig.tests.ExampleMain" ),
191
+ Compile / doc / sources := Seq .empty,
197
192
libraryDependencies ++= {
198
193
if (scalaVersion.value.startsWith(" 2." ))
199
194
Seq (
@@ -203,7 +198,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
203
198
},
204
199
graalVMNativeImageOptions ++= {
205
200
val reflectionFile =
206
- Keys .sourceDirectory.in( Compile ).value. / ( " graal" ). / ( " reflection.json" )
201
+ ( Compile / Keys .sourceDirectory).value / " graal" / " reflection.json"
207
202
assert(reflectionFile.exists, " no such file: " + reflectionFile)
208
203
List (
209
204
" -H:+ReportUnsupportedElementsAtRuntime" ,
@@ -223,39 +218,29 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform)
223
218
)
224
219
.jvmConfigure(
225
220
_.enablePlugins(GraalVMNativeImagePlugin )
226
- .dependsOn(typesafe, sconfigJVM)
227
- )
228
- .nativeSettings(
229
- crossScalaVersions -= scala3
221
+ .dependsOn(typesafe, sconfig.jvm)
230
222
)
231
223
.dependsOn(core)
232
224
233
- lazy val testsJVM = tests.jvm
234
- lazy val testsJS = tests.js
235
- lazy val testsNative = tests.native
236
-
237
225
lazy val docs = project
238
226
.in(file(" metaconfig-docs" ))
239
227
.settings(
240
228
sharedSettings,
241
- crossScalaVersions -= scala3,
242
229
libraryDependencies ++= List (
243
- " org.scalameta" %%% " munit-scalacheck" % V .munit
230
+ " com.lihaoyi" %%% " scalatags" % " 0.12.0" ,
231
+ " org.scalacheck" %%% " scalacheck" % V .scalacheck,
232
+ " org.scalameta" %%% " munit-scalacheck" % V .munit % Test
244
233
),
245
234
moduleName := " metaconfig-docs" ,
246
- libraryDependencies ++= List (
247
- " com.lihaoyi" %% " scalatags" % " 0.9.4"
248
- ).filter(_ => scalaVersion.value.startsWith(" 2." )),
249
235
mdocVariables := Map (
250
236
" VERSION" -> version.value.replaceFirst(" \\ +.*" , " " ),
251
237
" SCALA_VERSION" -> scalaVersion.value
252
238
),
253
- mdocOut :=
254
- baseDirectory.in(ThisBuild ).value / " website" / " target" / " docs" ,
239
+ mdocOut := (ThisBuild / baseDirectory).value / " website" / " target" / " docs" ,
255
240
mdocExtraArguments := List (" --no-link-hygiene" ),
256
241
// mdoc's metaconfig might (and will eventually) lag behind the current version, causing eviction errors
257
242
evictionErrorLevel := Level .Warn
258
243
)
259
- .dependsOn(coreJVM , typesafe, sconfigJVM )
244
+ .dependsOn(core.jvm , typesafe, sconfig.jvm )
260
245
.enablePlugins(DocusaurusPlugin )
261
246
.disablePlugins(MimaPlugin )
0 commit comments