Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
}
cmd: >-
sbt "
+ Test/compile;
set scriptedSbt := \"$MATRIX_SBT\";
set scriptedLaunchOpts += \"-Dscala.version=$MATRIX_SCALA\";
show scriptedSbt;
Expand Down
2 changes: 2 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ rewrite {
}
trailingCommas.style = keep # https://scalameta.org/scalafmt/docs/configuration.html#trailing-commas
}

project.layout = StandardConvention
26 changes: 23 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,32 @@ Global / onLoad := (Global / onLoad).value.andThen { s =>
s
}

crossScalaVersions += "3.7.3"

scalacOptions --= {
scalaBinaryVersion.value match {
case "3" =>
Seq("-Xfatal-warnings")
case _ =>
Nil
}
}

pluginCrossBuild / sbtVersion := {
scalaBinaryVersion.value match {
case "2.12" =>
sbtVersion.value
case _ =>
"2.0.0-RC5"
}
}

addCommandAlias(
"validateCode",
List(
"scalafmtSbtCheck",
"scalafmtCheckAll",
"javafmtCheckAll",
"headerCheck"
"+ scalafmtCheckAll",
"+ javafmtCheckAll",
"+ headerCheckAll"
).mkString(";")
)
21 changes: 21 additions & 0 deletions src/main/scala-2/com/github/sbt/maven/SbtMavenPluginCompat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) from 2023 The sbt contributors <https://github.com/sbt>
*/

package com.github.sbt.maven

import java.io.File

import sbt.Classpaths
import sbt.Configuration
import sbt.Keys.Classpath
import sbt.UpdateReport

private[maven] object SbtMavenPluginCompat {
def managedJars(
config: Configuration,
jarTypes: Set[String],
up: UpdateReport
): Seq[File] =
Classpaths.managedJars(config, jarTypes, up).map(_.data)
}
24 changes: 24 additions & 0 deletions src/main/scala-3/com/github/sbt/maven/SbtMavenPluginCompat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (C) from 2023 The sbt contributors <https://github.com/sbt>
*/

package com.github.sbt.maven

import java.io.File

import sbt.Classpaths
import sbt.Configuration
import sbt.Keys.fileConverter
import sbt.Keys.Classpath
import sbt.UpdateReport

private[maven] object SbtMavenPluginCompat {
inline def managedJars(
config: Configuration,
jarTypes: Set[String],
up: UpdateReport
): Seq[File] = {
val converter = fileConverter.value
Classpaths.managedJars(config, jarTypes, up, converter).map(x => converter.toPath(x.data).toFile)
}
}
5 changes: 3 additions & 2 deletions src/main/scala/com/github/sbt/maven/SbtMavenPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ object SbtMavenPlugin extends AutoPlugin {
val mavenVersion = settingKey[String]("Maven version")
val mavenPluginToolsVersion = settingKey[String]("Maven Plugin Tools version")

val MavenConf = Configurations.config("scripted-maven").hide
val MavenConf = Configurations.config("scripted-maven").hide
@transient
val mavenClasspath = taskKey[PathFinder]("")
val mavenLaunchOpts =
settingKey[Seq[String]]("options to pass to jvm launching Maven tasks")
Expand All @@ -66,7 +67,7 @@ object SbtMavenPlugin extends AutoPlugin {
private def scriptedMavenSettings: Seq[Setting[?]] = Seq(
ivyConfigurations += MavenConf,
mavenClasspath := Def.task {
PathFinder(Classpaths.managedJars(MavenConf, classpathTypes.value, Keys.update.value).map(_.data))
PathFinder(SbtMavenPluginCompat.managedJars(MavenConf, classpathTypes.value, Keys.update.value))
}.value,
scripted / sourceDirectory := sourceDirectory.value / "maven-test",
scripted := scriptedTask.evaluated,
Expand Down
Loading