Merge pull request #8156 from eed3si9n/wip/sonatype

[1.x] update to lm 1.11.2 and deprecate sonatypeOssSnapshots
This commit is contained in:
eugene yokota 2025-06-07 13:36:23 -04:00 committed by GitHub
commit 48c7700791
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 5 deletions

View File

@ -16,6 +16,7 @@ import java.net.URL
import sbt.io.Path
import Path._
import scala.annotation.nowarn
/** Options for well-known tasks. */
object Opts {
@ -42,22 +43,52 @@ object Opts {
}
object resolver {
import sbt.io.syntax._
@deprecated("Use sonatypeOssReleases instead", "1.7.0")
@deprecated("Sonatype OSS Repository Hosting (OSSRH) will be sunset on 2025-06-30", "1.7.0")
val sonatypeReleases = Resolver.sonatypeRepo("releases")
@deprecated("Sonatype OSS Repository Hosting (OSSRH) will be sunset on 2025-06-30", "1.11.2")
val sonatypeOssReleases = Resolver.sonatypeOssRepos("releases")
@deprecated("Use sonatypeOssSnapshots instead", "1.7.0")
@deprecated(
"""Sonatype OSS Repository Hosting (OSSRH) will be sunset on 2025-06-30; use the following instead:
resolvers += Resolver.sonatypeCentralSnapshots""",
"1.7.0"
)
val sonatypeSnapshots = Resolver.sonatypeRepo("snapshots")
@deprecated(
"""Sonatype OSS Repository Hosting (OSSRH) will be sunset on 2025-06-30; use the following instead:
resolvers += Resolver.sonatypeCentralSnapshots""",
"1.11.2"
)
val sonatypeOssSnapshots = Resolver.sonatypeOssRepos("snapshots")
@deprecated(
"""Sonatype OSS Repository Hosting (OSSRH) will be sunset on 2025-06-30; use the following instead:
publishTo := {
if (isSnapshot.value) Some(Resolver.sonatypeCentralSnapshots)
else localStaging.value
}""",
"1.11.2"
)
val sonatypeStaging = MavenRepository(
"sonatype-staging",
"https://oss.sonatype.org/service/local/staging/deploy/maven2"
)
val mavenLocalFile = Resolver.file("Local Repository", userHome / ".m2" / "repository")(
Resolver.defaultPatterns
)
@deprecated(
"""Bintray was shut down""",
"1.11.2"
)
val sbtSnapshots = Resolver.bintrayRepo("sbt", "maven-snapshots")
@deprecated(
"""Bintray was shut down""",
"1.11.2"
)
val sbtIvySnapshots = Resolver.bintrayIvyRepo("sbt", "ivy-snapshots")
}
}
@ -77,10 +108,14 @@ object DefaultOptions {
doc.title(name) ++ doc.version(version)
def resolvers(snapshot: Boolean): Vector[Resolver] = {
if (snapshot) Vector(resolver.sbtSnapshots) else Vector.empty
if (snapshot) Vector(resolver.sbtSnapshots: @nowarn("cat=deprecation")) else Vector.empty
}
def pluginResolvers(plugin: Boolean, snapshot: Boolean): Vector[Resolver] = {
if (plugin && snapshot) Vector(resolver.sbtSnapshots, resolver.sbtIvySnapshots)
if (plugin && snapshot)
Vector(
resolver.sbtSnapshots: @nowarn("cat=deprecation"),
resolver.sbtIvySnapshots: @nowarn("cat=deprecation"),
)
else Vector.empty
}
def addResolvers: Setting[_] = Keys.resolvers ++= { resolvers(Keys.isSnapshot.value) }

View File

@ -14,7 +14,7 @@ object Dependencies {
// sbt modules
private val ioVersion = nightlyVersion.getOrElse("1.10.5")
private val lmVersion =
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.11.0")
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.11.2")
val zincVersion = nightlyVersion.getOrElse("1.10.8")
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion