Merge pull request #238 from jalaziz/cross-versioned-excludes

Add cross version support with excludeDependencies
This commit is contained in:
Alexandre Archambault 2016-04-24 19:07:58 +02:00
commit 6010d1bfbf
3 changed files with 6 additions and 3 deletions

View File

@ -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)

View File

@ -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"

View File

@ -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"))
}