mirror of https://github.com/sbt/sbt.git
[2.x] fix: Fixes sbt 2.x pluing resolution (#8743)
**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:
parent
14211d7c4f
commit
eaa1c0845d
|
|
@ -4371,6 +4371,7 @@ object Classpaths {
|
||||||
val sbtMavenSnapshots: MavenRepository =
|
val sbtMavenSnapshots: MavenRepository =
|
||||||
MavenRepository("sbt-maven-snapshot", Resolver.SbtRepositoryRoot + "/" + "maven-snapshots/")
|
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 =
|
def modifyForPlugin(plugin: Boolean, dep: ModuleID): ModuleID =
|
||||||
if (plugin) dep.withConfigurations(Some(Provided.name)) else dep
|
if (plugin) dep.withConfigurations(Some(Provided.name)) else dep
|
||||||
|
|
||||||
|
|
@ -4380,11 +4381,10 @@ object Classpaths {
|
||||||
org: String,
|
org: String,
|
||||||
version: String
|
version: String
|
||||||
): Seq[ModuleID] =
|
): Seq[ModuleID] =
|
||||||
if (auto)
|
if auto then
|
||||||
modifyForPlugin(plugin, ScalaArtifacts.libraryDependency(org, version))
|
if ScalaArtifacts.isScala3(version) then ScalaArtifacts.libraryDependency(org, version) :: Nil
|
||||||
.platform(Platform.jvm) :: Nil
|
else (modifyForPlugin(plugin, ScalaArtifacts.libraryDependency(org, version)): @nowarn) :: Nil
|
||||||
else
|
else Nil
|
||||||
Nil
|
|
||||||
|
|
||||||
def addUnmanagedLibrary: Seq[Setting[?]] =
|
def addUnmanagedLibrary: Seq[Setting[?]] =
|
||||||
Seq((Compile / unmanagedJars) ++= unmanagedScalaLibrary.value)
|
Seq((Compile / unmanagedJars) ++= unmanagedScalaLibrary.value)
|
||||||
|
|
|
||||||
|
|
@ -1 +1,2 @@
|
||||||
scalaVersion := "3.8.1"
|
scalaVersion := "3.8.1"
|
||||||
|
publishLocal := {}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
// addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.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")
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue