summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorTobias Roeser <le.petit.fou@web.de>2018-10-29 10:16:59 +0100
committerTobias Roeser <le.petit.fou@web.de>2018-10-29 20:44:10 +0100
commit56d4537bec253ea00d59a148522add366c11dece (patch)
tree2ab44dd0b9902b5b6173830fa8d2c4f97ea1931a /main
parentb44e2b9f54a6edeb5ac46032147fcd5d51a6f376 (diff)
downloadmill-56d4537bec253ea00d59a148522add366c11dece.tar.gz
mill-56d4537bec253ea00d59a148522add366c11dece.tar.bz2
mill-56d4537bec253ea00d59a148522add366c11dece.zip
Added some source docs
Diffstat (limited to 'main')
-rw-r--r--main/core/src/mill/define/Graph.scala13
1 files changed, 12 insertions, 1 deletions
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 = {