mirror of https://github.com/sbt/sbt.git
Better minimization of dependencies with fallback configs
This commit is contained in:
parent
403b3ddf7d
commit
2e6e061fe1
|
|
@ -122,8 +122,16 @@ object Orders {
|
|||
|
||||
private def fallbackConfigIfNecessary(dep: Dependency, configs: Set[String]): Dependency =
|
||||
Parse.withFallbackConfig(dep.configuration) match {
|
||||
case Some((main, fallback)) if !configs(main) && configs(fallback) =>
|
||||
dep.copy(configuration = fallback)
|
||||
case Some((main, fallback)) =>
|
||||
val config0 =
|
||||
if (configs(main))
|
||||
main
|
||||
else if (configs(fallback))
|
||||
fallback
|
||||
else
|
||||
dep.configuration
|
||||
|
||||
dep.copy(configuration = config0)
|
||||
case _ =>
|
||||
dep
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue