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 =>
|
rule =>
|
||||||
if (
|
if (
|
||||||
rule.artifact != "*" ||
|
rule.artifact != "*" ||
|
||||||
rule.configurations.nonEmpty ||
|
rule.configurations.nonEmpty
|
||||||
rule.crossVersion != sbt.CrossVersion.Disabled
|
|
||||||
) {
|
) {
|
||||||
log.warn(s"Unsupported exclusion rule $rule")
|
log.warn(s"Unsupported exclusion rule $rule")
|
||||||
anyNonSupportedExclusionRule = true
|
anyNonSupportedExclusionRule = true
|
||||||
Nil
|
Nil
|
||||||
} else
|
} else
|
||||||
Seq((rule.organization, rule.name))
|
Seq((rule.organization,
|
||||||
|
FromSbt.sbtCrossVersionName(rule.name, rule.crossVersion, sv, sbv)))
|
||||||
}.toSet
|
}.toSet
|
||||||
|
|
||||||
if (anyNonSupportedExclusionRule)
|
if (anyNonSupportedExclusionRule)
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,4 @@ scalaVersion := "2.11.8"
|
||||||
libraryDependencies += "com.github.alexarchambault" %% "argonaut-shapeless_6.1" % "1.0.0-RC1"
|
libraryDependencies += "com.github.alexarchambault" %% "argonaut-shapeless_6.1" % "1.0.0-RC1"
|
||||||
|
|
||||||
excludeDependencies += SbtExclusionRule("com.chuusai", "shapeless_2.11")
|
excludeDependencies += SbtExclusionRule("com.chuusai", "shapeless_2.11")
|
||||||
|
excludeDependencies += "io.argonaut" %% "argonaut"
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,12 @@ object Main extends App {
|
||||||
).toOption.nonEmpty
|
).toOption.nonEmpty
|
||||||
|
|
||||||
val shapelessFound = classFound("shapeless.HList")
|
val shapelessFound = classFound("shapeless.HList")
|
||||||
|
val argonautFound = classFound("argonaut.Json")
|
||||||
val argonautShapelessFound = classFound("argonaut.derive.MkEncodeJson")
|
val argonautShapelessFound = classFound("argonaut.derive.MkEncodeJson")
|
||||||
|
|
||||||
assert(argonautShapelessFound)
|
assert(argonautShapelessFound)
|
||||||
assert(!shapelessFound)
|
assert(!shapelessFound)
|
||||||
|
assert(!argonautFound)
|
||||||
|
|
||||||
Files.write(new File("output").toPath, "OK".getBytes("UTF-8"))
|
Files.write(new File("output").toPath, "OK".getBytes("UTF-8"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue