Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use new slash syntax instead of deprecated in #902

Merged
merged 1 commit into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ lazy val plugin = project
sharedSettings,
sbtPlugin := true,
scalaVersion := scala212,
pluginCrossBuild / sbtVersion := "1.0.0",
pluginCrossBuild / sbtVersion := "1.1.0",
crossScalaVersions := List(scala212),
moduleName := "sbt-mdoc",
libraryDependencies ++= List(
Expand Down
8 changes: 4 additions & 4 deletions mdoc-sbt/src/main/scala/mdoc/DocusaurusPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object DocusaurusPlugin extends AutoPlugin {
import autoImport._
def website: Def.Initialize[File] =
Def.setting {
baseDirectory.in(ThisBuild).value / "website"
(ThisBuild / baseDirectory).value / "website"
}

def listJarFiles(root: Path): List[(File, String)] = {
Expand Down Expand Up @@ -95,8 +95,8 @@ object DocusaurusPlugin extends AutoPlugin {

override def projectSettings: Seq[Def.Setting[_]] =
List(
aggregate.in(docusaurusPublishGhpages) := false,
aggregate.in(docusaurusCreateSite) := false,
(docusaurusPublishGhpages / aggregate) := false,
(docusaurusCreateSite / aggregate) := false,
docusaurusProjectName := moduleName.value.stripSuffix("-docs"),
MdocPlugin.mdocInternalVariables ++= List(
"js-out-prefix" -> "assets"
Expand Down Expand Up @@ -146,7 +146,7 @@ object DocusaurusPlugin extends AutoPlugin {
Relativize.htmlSite(out.toPath)
out
},
packageDoc.in(Compile) := {
(Compile / packageDoc) := {
val directory = doc.value
val jar = target.value / "docusaurus.jar"
val files = listJarFiles(directory.toPath)
Expand Down
24 changes: 12 additions & 12 deletions mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ object MdocPlugin extends AutoPlugin {

override def projectSettings: Seq[Def.Setting[_]] =
List(
mdocIn := baseDirectory.in(ThisBuild).value / "docs",
mdocOut := target.in(Compile).value / "mdoc",
mdocIn := (ThisBuild / baseDirectory).value / "docs",
mdocOut := (Compile / target).value / "mdoc",
mdocVariables := Map.empty,
mdocExtraArguments := Nil,
mdocJS := None,
Expand All @@ -96,7 +96,7 @@ object MdocPlugin extends AutoPlugin {
parsed
).flatten.mkString(" ")
Def.taskDyn {
runMain.in(Compile).toTask(s" mdoc.SbtMain $args")
(Compile / runMain).toTask(s" mdoc.SbtMain $args")
}
}.evaluated,
dependencyOverrides ++= List(
Expand All @@ -114,9 +114,9 @@ object MdocPlugin extends AutoPlugin {
List()
}
},
resourceGenerators.in(Compile) += Def.task {
(Compile / resourceGenerators) += Def.task {
val out =
managedResourceDirectories.in(Compile).value.head / "mdoc.properties"
(Compile / managedResourceDirectories).value.head / "mdoc.properties"
val props = new java.util.Properties()
mdocVariables.value.foreach { case (key, value) =>
props.put(key, value)
Expand All @@ -126,9 +126,9 @@ object MdocPlugin extends AutoPlugin {
}
def getJars(mid: ModuleID) = {

val depRes = dependencyResolution.in(update).value
val updc = updateConfiguration.in(update).value
val uwconfig = unresolvedWarningConfiguration.in(update).value
val depRes = (update / dependencyResolution).value
val updc = (update / updateConfiguration).value
val uwconfig = (update / unresolvedWarningConfiguration).value
val modDescr = depRes.wrapDependencyInModule(mid)

depRes
Expand Down Expand Up @@ -190,21 +190,21 @@ object MdocPlugin extends AutoPlugin {
props.put("out", mdocOut.value.toString)
props.put(
"scalacOptions",
scalacOptions.in(Compile).value.mkString(" ")
(Compile / scalacOptions).value.mkString(" ")
)
val classpath = ListBuffer.empty[File]
// Can't use fullClasspath.value because it introduces cyclic dependency between
// compilation and resource generation.
classpath ++= dependencyClasspath.in(Compile).value.iterator.map(_.data)
classpath += classDirectory.in(Compile).value
classpath ++= (Compile / dependencyClasspath).value.iterator.map(_.data)
classpath += (Compile / classDirectory).value
props.put(
"classpath",
classpath.mkString(java.io.File.pathSeparator)
)
IO.write(props, "mdoc properties", out)
val esVersion = props.clone().asInstanceOf[java.util.Properties]
esVersion.put("js-module-kind", "ESModule")
val esOut = managedResourceDirectories.in(Compile).value.head / "es.properties"
val esOut = (Compile / managedResourceDirectories).value.head / "es.properties"
IO.write(
esVersion,
"mdoc esmoddule properties",
Expand Down