mirror of https://github.com/sbt/sbt.git
Return empty graph if no update report is found
This commit is contained in:
parent
91cb6e0931
commit
db73b6d83c
|
|
@ -122,7 +122,7 @@ object DependencyGraphSettings {
|
||||||
def moduleGraphIvyReportTask = ivyReport map (absoluteReportPath.andThen(IvyReport.fromReportFile))
|
def moduleGraphIvyReportTask = ivyReport map (absoluteReportPath.andThen(IvyReport.fromReportFile))
|
||||||
def moduleGraphSbtTask =
|
def moduleGraphSbtTask =
|
||||||
(ignoreMissingUpdate, crossProjectId, configuration) map { (update, root, config) ⇒
|
(ignoreMissingUpdate, crossProjectId, configuration) map { (update, root, config) ⇒
|
||||||
SbtUpdateReport.fromConfigurationReport(update.configuration(config.name).get, root)
|
update.configuration(config.name).map(report ⇒ SbtUpdateReport.fromConfigurationReport(report, root)).getOrElse(ModuleGraph.empty)
|
||||||
}
|
}
|
||||||
|
|
||||||
def printAsciiGraphTask =
|
def printAsciiGraphTask =
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,10 @@ case class Module(id: ModuleId,
|
||||||
def isEvicted: Boolean = evictedByVersion.isDefined
|
def isEvicted: Boolean = evictedByVersion.isDefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object ModuleGraph {
|
||||||
|
val empty = ModuleGraph(Seq.empty, Seq.empty)
|
||||||
|
}
|
||||||
|
|
||||||
case class ModuleGraph(nodes: Seq[Module], edges: Seq[Edge]) {
|
case class ModuleGraph(nodes: Seq[Module], edges: Seq[Edge]) {
|
||||||
lazy val modules: Map[ModuleId, Module] =
|
lazy val modules: Map[ModuleId, Module] =
|
||||||
nodes.map(n ⇒ (n.id, n)).toMap
|
nodes.map(n ⇒ (n.id, n)).toMap
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue