Add cross version support with excludeDependencies

This commit is contained in:
Jameel Al-Aziz 2016-04-22 03:01:22 -07:00
parent d2984cc51b
commit 4d3f9e2041
No known key found for this signature in database
GPG Key ID: D2C1CC4F32861B8D
3 changed files with 6 additions and 3 deletions

View File

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

View File

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

View File

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