Use rename custom strategy to support caching
This commit is contained in:
19
build.sbt
19
build.sbt
@@ -4,20 +4,17 @@ import Tests._
|
|||||||
// implicit one
|
// implicit one
|
||||||
lazy val chipyardRoot = Project("chipyardRoot", file("."))
|
lazy val chipyardRoot = Project("chipyardRoot", file("."))
|
||||||
|
|
||||||
// keep chisel/firrtl specific class files, drop other conflicts
|
// keep chisel/firrtl specific class files, rename other conflicts
|
||||||
val chiselFirrtlMergeStrategy = CustomMergeStrategy("cfmergestrategy") { deps =>
|
val chiselFirrtlMergeStrategy = CustomMergeStrategy.rename { dep =>
|
||||||
import sbtassembly.Assembly.{Project, Library}
|
import sbtassembly.Assembly.{Project, Library}
|
||||||
val keepDeps = deps.filter { dep =>
|
val nm = dep match {
|
||||||
val nm = dep match {
|
case p: Project => p.name
|
||||||
case p: Project => p.name
|
case l: Library => l.moduleCoord.name
|
||||||
case l: Library => l.moduleCoord.name
|
|
||||||
}
|
|
||||||
Seq("firrtl", "chisel3").contains(nm.split("_")(0)) // split by _ to avoid checking on major/minor version
|
|
||||||
}
|
}
|
||||||
if (keepDeps.size <= 1) {
|
if (Seq("firrtl", "chisel3").contains(nm.split("_")(0))) { // split by _ to avoid checking on major/minor version
|
||||||
Right(keepDeps.map(dep => JarEntry(dep.target, dep.stream)))
|
dep.target
|
||||||
} else {
|
} else {
|
||||||
Left(s"Unable to resolve conflict (${keepDeps.size}>1 conflicts):\n${keepDeps.mkString("\n")}")
|
"renamed/" + dep.target
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user