[2.x] fix: Fixes sbt 2.x pluing resolution

**Problem**
Adopting Scala 3.8 on sbt 2.x has created confusing errors with scala-library mismatch,
popping up as undefined summon.

**Solution**
Removing the Provided scope seems to work.
This commit is contained in:
Eugene Yokota 2026-02-15 01:00:02 -05:00
parent 14211d7c4f
commit f3f7de247e
3 changed files with 7 additions and 7 deletions

View File

@ -4371,6 +4371,7 @@ object Classpaths {
val sbtMavenSnapshots: MavenRepository =
MavenRepository("sbt-maven-snapshot", Resolver.SbtRepositoryRoot + "/" + "maven-snapshots/")
@deprecated("no longer true for sbt 2.x", "2.0.0")
def modifyForPlugin(plugin: Boolean, dep: ModuleID): ModuleID =
if (plugin) dep.withConfigurations(Some(Provided.name)) else dep
@ -4380,11 +4381,10 @@ object Classpaths {
org: String,
version: String
): Seq[ModuleID] =
if (auto)
modifyForPlugin(plugin, ScalaArtifacts.libraryDependency(org, version))
.platform(Platform.jvm) :: Nil
else
Nil
if auto then
if ScalaArtifacts.isScala3(version) then ScalaArtifacts.libraryDependency(org, version) :: Nil
else (modifyForPlugin(plugin, ScalaArtifacts.libraryDependency(org, version)): @nowarn) :: Nil
else Nil
def addUnmanagedLibrary: Seq[Setting[?]] =
Seq((Compile / unmanagedJars) ++= unmanagedScalaLibrary.value)

View File

@ -1 +1,2 @@
scalaVersion := "3.8.1"
publishLocal := {}

View File

@ -1,2 +1 @@
// addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")
libraryDependencies += Defaults.sbtPluginExtra("com.github.sbt" % "sbt-pgp" % "2.3.1", "2", "3.8.1")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.1")