Merge pull request #4829 from eed3si9n/wip/crossplugin

add back typesafe-ivy-releases resolver
This commit is contained in:
eugene yokota 2019-06-23 20:44:59 -04:00 committed by GitHub
commit 9cc8913131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 15 deletions

View File

@ -219,6 +219,11 @@ object Defaults extends BuildCommon {
if (v.endsWith("-SNAPSHOT") || v.contains("-bin-")) Classpaths.sbtMavenSnapshots
else Resolver.DefaultMavenRepository
},
sbtResolvers := {
// TODO: Remove Classpaths.typesafeReleases for sbt 2.x
// We need to keep it around for sbt 1.x to cross build plugins with sbt 0.13 - https://github.com/sbt/sbt/issues/4698
Vector(sbtResolver.value, Classpaths.sbtPluginReleases, Classpaths.typesafeReleases)
},
crossVersion :== Disabled(),
buildDependencies := Classpaths.constructBuildDependencies.value,
version :== "0.1.0-SNAPSHOT",
@ -2163,9 +2168,8 @@ object Classpaths {
bootResolvers.value match {
case Some(repos) if overrideBuildResolvers.value => proj +: repos
case _ =>
val sbtResolverValue = sbtResolver.value
val base = if (sbtPlugin.value) sbtResolverValue +: sbtPluginReleases +: rs else rs
proj +: base
val base = if (sbtPlugin.value) sbtResolvers.value ++ rs else rs
(proj +: base).distinct
}
}).value,
moduleName := normalizedName.value,

View File

@ -443,6 +443,7 @@ object Keys {
val autoScalaLibrary = settingKey[Boolean]("Adds a dependency on scala-library if true.").withRank(ASetting)
val managedScalaInstance = settingKey[Boolean]("Automatically obtains Scala tools as managed dependencies if true.").withRank(BSetting)
val sbtResolver = settingKey[Resolver]("Provides a resolver for obtaining sbt as a dependency.").withRank(BMinusSetting)
val sbtResolvers = settingKey[Seq[Resolver]]("The external resolvers for sbt and plugin dependencies.").withRank(BMinusSetting)
val sbtDependency = settingKey[ModuleID]("Provides a definition for declaring the current version of sbt.").withRank(BMinusSetting)
val sbtVersion = settingKey[String]("Provides the version of sbt. This setting should not be modified.").withRank(AMinusSetting)
val sbtBinaryVersion = settingKey[String]("Defines the binary compatibility version substring.").withRank(BPlusSetting)

View File

@ -64,11 +64,7 @@ object CoursierRepositoriesTasks {
case None =>
val extRes = externalResolvers.value
val isSbtPlugin = sbtPlugin.value
if (isSbtPlugin)
Seq(
sbtResolver.value,
Classpaths.sbtPluginReleases
) ++ extRes
if (isSbtPlugin) sbtResolvers.value ++ extRes
else extRes
}
val reorderResolvers = true // coursierReorderResolvers.value

View File

@ -1,20 +1,16 @@
val baseSbt = "1."
val buildCrossList = List("2.10.6", "2.11.11", "2.12.2")
scalaVersion in ThisBuild := "2.12.2"
val buildCrossList = List("2.10.7", "2.11.12", "2.12.8")
scalaVersion in ThisBuild := "2.12.8"
crossScalaVersions in ThisBuild := buildCrossList
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")
lazy val root = (project in file("."))
.enablePlugins(SbtPlugin)
.settings(
sbtPlugin := true,
TaskKey[Unit]("check") := mkCheck("2.12", "1.0", "1.").value,
TaskKey[Unit]("check2") := mkCheck("2.10", "0.13", "0.13").value,
// Coursier requires extra resolver for sbt 0.13
resolvers += Resolver.typesafeIvyRepo("releases"),
)
lazy val app = (project in file("app"))