mirror of https://github.com/sbt/sbt.git
Add cross version support with excludeDependencies
This commit is contained in:
parent
d2984cc51b
commit
4d3f9e2041
|
|
@ -267,14 +267,14 @@ object Tasks {
|
|||
rule =>
|
||||
if (
|
||||
rule.artifact != "*" ||
|
||||
rule.configurations.nonEmpty ||
|
||||
rule.crossVersion != sbt.CrossVersion.Disabled
|
||||
rule.configurations.nonEmpty
|
||||
) {
|
||||
log.warn(s"Unsupported exclusion rule $rule")
|
||||
anyNonSupportedExclusionRule = true
|
||||
Nil
|
||||
} else
|
||||
Seq((rule.organization, rule.name))
|
||||
Seq((rule.organization,
|
||||
FromSbt.sbtCrossVersionName(rule.name, rule.crossVersion, sv, sbv)))
|
||||
}.toSet
|
||||
|
||||
if (anyNonSupportedExclusionRule)
|
||||
|
|
|
|||
|
|
@ -3,3 +3,4 @@ scalaVersion := "2.11.8"
|
|||
libraryDependencies += "com.github.alexarchambault" %% "argonaut-shapeless_6.1" % "1.0.0-RC1"
|
||||
|
||||
excludeDependencies += SbtExclusionRule("com.chuusai", "shapeless_2.11")
|
||||
excludeDependencies += "io.argonaut" %% "argonaut"
|
||||
|
|
|
|||
|
|
@ -12,10 +12,12 @@ object Main extends App {
|
|||
).toOption.nonEmpty
|
||||
|
||||
val shapelessFound = classFound("shapeless.HList")
|
||||
val argonautFound = classFound("argonaut.Json")
|
||||
val argonautShapelessFound = classFound("argonaut.derive.MkEncodeJson")
|
||||
|
||||
assert(argonautShapelessFound)
|
||||
assert(!shapelessFound)
|
||||
assert(!argonautFound)
|
||||
|
||||
Files.write(new File("output").toPath, "OK".getBytes("UTF-8"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue