From 56d4537bec253ea00d59a148522add366c11dece Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Mon, 29 Oct 2018 10:16:59 +0100 Subject: Added some source docs --- main/core/src/mill/define/Graph.scala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/core/src/mill/define/Graph.scala b/main/core/src/mill/define/Graph.scala index f06dca11..3119f2fb 100644 --- a/main/core/src/mill/define/Graph.scala +++ b/main/core/src/mill/define/Graph.scala @@ -5,7 +5,14 @@ import mill.util.MultiBiMap import mill.util.Strict.Agg object Graph { - class TopoSorted private[Graph](val values: Agg[Task[_]]) + + /** + * The `values` [[Agg]] is guaranteed to be topological sorted and cycle free. + * That's why the constructor is package private. + * @see [[Graph.topoSorted]] + */ + class TopoSorted private[Graph] (val values: Agg[Task[_]]) + def groupAroundImportantTargets[T](topoSortedTargets: TopoSorted) (important: PartialFunction[Task[_], T]): MultiBiMap[T, Task[_]] = { @@ -27,6 +34,10 @@ object Graph { output } + /** + * Collects all transitive dependencies (targets) of the given targets, + * including the given targets. + */ def transitiveTargets(sourceTargets: Agg[Task[_]]): Agg[Task[_]] = { val transitiveTargets = new Agg.Mutable[Task[_]] def rec(t: Task[_]): Unit = { -- cgit v1.2.3