Skip to content

Commit b46cebd

Browse files
authored
Merge pull request #482 from ckipp01/unified
2 parents e0455f6 + 332194c commit b46cebd

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

build.sbt

+34-34
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ val isScalaJs1 = Def.setting {
2929

3030
def multiScalaDirectories(projectName: String) =
3131
Def.setting {
32-
val root = baseDirectory.in(ThisBuild).value / projectName
32+
val root = (ThisBuild / baseDirectory).value / projectName
3333
val base = root / "src" / "main"
3434
val result = mutable.ListBuffer.empty[File]
3535
val partialVersion = CrossVersion.partialVersion(scalaVersion.value)
@@ -89,15 +89,15 @@ inThisBuild(
8989
testFrameworks := List(new TestFramework("munit.Framework")),
9090
resolvers += Resolver.sonatypeRepo("public"),
9191
// faster publishLocal:
92-
publishArtifact.in(packageDoc) := "true" == System.getenv("CI"),
93-
publishArtifact.in(packageSrc) := "true" == System.getenv("CI"),
92+
packageDoc / publishArtifact := "true" == System.getenv("CI"),
93+
packageSrc / publishArtifact := "true" == System.getenv("CI"),
9494
turbo := true,
9595
useSuperShell := false // overlaps with MUnit test failure reports.
9696
)
9797
)
9898

9999
name := "mdocRoot"
100-
skip in publish := true
100+
publish / skip := true
101101
crossScalaVersions := Nil
102102
lazy val sharedSettings = List(
103103
scalacOptions ++= crossSetting(
@@ -135,15 +135,15 @@ lazy val interfaces = project
135135
"io.get-coursier" % "interface" % V.coursier
136136
),
137137
// @note needed to deal with issues with dottyDoc
138-
sources in (Compile, doc) := {
138+
Compile / doc / sources := {
139139
if (isScala3.value) {
140140
Seq.empty
141141
} else {
142-
(sources in (Compile, doc)).value
142+
(Compile / doc / sources).value
143143
}
144144
},
145145
crossVersion := CrossVersion.disabled,
146-
javacOptions in (Compile / doc) ++= List(
146+
Compile / doc / javacOptions ++= List(
147147
"-tag",
148148
"implNote:a:Implementation Note:"
149149
)
@@ -153,7 +153,7 @@ lazy val runtime = project
153153
.settings(
154154
sharedSettings,
155155
moduleName := "mdoc-runtime",
156-
unmanagedSourceDirectories.in(Compile) ++= multiScalaDirectories("runtime").value,
156+
Compile / unmanagedSourceDirectories ++= multiScalaDirectories("runtime").value,
157157
libraryDependencies ++= crossSetting(
158158
scalaVersion.value,
159159
if2 = List(
@@ -173,18 +173,18 @@ val excludePprint = ExclusionRule(organization = "com.lihaoyi")
173173
lazy val mdoc = project
174174
.settings(
175175
sharedSettings,
176-
unmanagedSourceDirectories.in(Compile) ++= multiScalaDirectories("mdoc").value,
176+
Compile / unmanagedSourceDirectories ++= multiScalaDirectories("mdoc").value,
177177
moduleName := "mdoc",
178-
mainClass in assembly := Some("mdoc.Main"),
179-
assemblyJarName in assembly := "mdoc.jar",
180-
test in assembly := {},
181-
assemblyMergeStrategy.in(assembly) ~= { old =>
178+
assembly / mainClass := Some("mdoc.Main"),
179+
assembly / assemblyJarName := "mdoc.jar",
180+
assembly / test := {},
181+
assembly / assemblyMergeStrategy ~= { old =>
182182
{
183183
case PathList("META-INF", "CHANGES") => MergeStrategy.discard
184184
case x => old(x)
185185
}
186186
},
187-
fork in run := true,
187+
run / fork := true,
188188
buildInfoPackage := "mdoc.internal",
189189
buildInfoKeys := Seq[BuildInfoKey](
190190
version,
@@ -227,7 +227,7 @@ lazy val testsInput = project
227227
.in(file("tests/input"))
228228
.settings(
229229
sharedSettings,
230-
skip in publish := true
230+
publish / skip := true
231231
)
232232

233233
def scala212LibraryDependencies(deps: List[ModuleID]) =
@@ -241,7 +241,7 @@ val tests = project
241241
.in(file("tests/tests"))
242242
.settings(
243243
sharedSettings,
244-
skip in publish := true,
244+
publish / skip := true,
245245
libraryDependencies ++= List(
246246
"org.scalameta" %% "munit" % V.munit
247247
),
@@ -257,7 +257,7 @@ val jsdocs = project
257257
.in(file("tests/jsdocs"))
258258
.settings(
259259
sharedSettings,
260-
skip in publish := true,
260+
publish / skip := true,
261261
crossScalaVersions --= scala3,
262262
scalaJSLinkerConfig ~= {
263263
_.withModuleKind(ModuleKind.CommonJSModule)
@@ -266,7 +266,7 @@ val jsdocs = project
266266
"org.scala-js" %%% "scalajs-dom" % scalajsDom
267267
),
268268
scalaJSUseMainModuleInitializer := true,
269-
npmDependencies in Compile ++= List(
269+
Compile / npmDependencies ++= List(
270270
"ms" -> "2.1.1"
271271
),
272272
webpackBundlingMode := BundlingMode.LibraryOnly()
@@ -277,7 +277,7 @@ lazy val worksheets = project
277277
.in(file("tests/worksheets"))
278278
.settings(
279279
sharedSettings,
280-
skip in publish := true,
280+
publish / skip := true,
281281
libraryDependencies ++= List(
282282
"org.scalameta" %% "munit" % V.munit % Test
283283
)
@@ -288,7 +288,7 @@ lazy val unit = project
288288
.in(file("tests/unit"))
289289
.settings(
290290
sharedSettings,
291-
skip in publish := true,
291+
publish / skip := true,
292292
crossScalaVersions --= scala3,
293293
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3"),
294294
resolvers += Resolver.bintrayRepo("cibotech", "public"),
@@ -305,7 +305,7 @@ lazy val unit = project
305305
),
306306
buildInfoPackage := "tests.cli",
307307
buildInfoKeys := Seq[BuildInfoKey](
308-
"testsInputClassDirectory" -> classDirectory.in(testsInput, Compile).value
308+
"testsInputClassDirectory" -> (testsInput / Compile / classDirectory).value
309309
),
310310
mdocJS := Some(jsdocs)
311311
)
@@ -317,7 +317,7 @@ lazy val plugin = project
317317
.settings(
318318
sharedSettings,
319319
sbtPlugin := true,
320-
sbtVersion in pluginCrossBuild := "1.0.0",
320+
pluginCrossBuild / sbtVersion := "1.0.0",
321321
crossScalaVersions := List(scala212),
322322
moduleName := "sbt-mdoc",
323323
libraryDependencies ++= List(
@@ -326,20 +326,20 @@ lazy val plugin = project
326326
"org.scalameta" %% "munit" % V.munit % Test,
327327
"org.scalameta" %% "testkit" % V.scalameta % Test
328328
),
329-
resourceGenerators.in(Compile) += Def.task {
329+
Compile / resourceGenerators += Def.task {
330330
val out =
331-
managedResourceDirectories.in(Compile).value.head / "sbt-mdoc.properties"
331+
(Compile / managedResourceDirectories).value.head / "sbt-mdoc.properties"
332332
val props = new java.util.Properties()
333333
props.put("version", version.value)
334334
IO.write(props, "sbt-mdoc properties", out)
335335
List(out)
336336
},
337337
publishLocal := publishLocal
338338
.dependsOn(
339-
publishLocal in interfaces,
340-
publishLocal in runtime,
341-
publishLocal in mdoc,
342-
publishLocal in js
339+
interfaces / publishLocal,
340+
runtime / publishLocal,
341+
mdoc / publishLocal,
342+
js / publishLocal
343343
)
344344
.value,
345345
scriptedBufferLog := false,
@@ -370,20 +370,20 @@ lazy val docs = project
370370
sharedSettings,
371371
moduleName := "mdoc-docs",
372372
crossScalaVersions := List(scala212),
373-
skip in publish :=
373+
publish / skip :=
374374
!scalaVersion.value.startsWith("2.12") ||
375-
version.in(ThisBuild).value.endsWith("-SNAPSHOT"),
375+
(ThisBuild / version).value.endsWith("-SNAPSHOT"),
376376
mdocAutoDependency := false,
377377
resolvers += Resolver.bintrayRepo("cibotech", "public"),
378378
libraryDependencies ++= List(
379379
"org.scala-sbt" % "sbt" % sbtVersion.value,
380380
"com.cibo" %% "evilplot" % "0.6.3"
381381
),
382-
watchSources += baseDirectory.in(ThisBuild).value / "docs",
383-
cancelable in Global := true,
384-
MdocPlugin.autoImport.mdoc := run.in(Compile).evaluated,
382+
watchSources += (ThisBuild / baseDirectory).value / "docs",
383+
Global / cancelable := true,
384+
MdocPlugin.autoImport.mdoc := (Compile / run).evaluated,
385385
mdocJS := Some(jsdocs),
386-
mdocJSLibraries := webpack.in(jsdocs, Compile, fullOptJS).value,
386+
mdocJSLibraries := (jsdocs / Compile / fullOptJS / webpack).value,
387387
mdocVariables := {
388388
val stableVersion: String =
389389
version.value.replaceFirst("\\+.*", "")

0 commit comments

Comments
 (0)