@@ -71,20 +71,20 @@ private[mill] trait EvaluatorCore extends GroupEvaluator {
7171 os.makeDir.all(outPath)
7272
7373 val threadNumberer = new ThreadNumberer ()
74- val (sortedGroups, transitive) = Plan .plan(goals)
75- val interGroupDeps = EvaluatorCore .findInterGroupDeps(sortedGroups)
76- val terminals0 = sortedGroups.keys().toVector
74+ val plan = Plan .plan(goals)
75+ val interGroupDeps = EvaluatorCore .findInterGroupDeps(plan. sortedGroups)
76+ val terminals0 = plan. sortedGroups.keys().toVector
7777 val failed = new AtomicBoolean (false )
7878 val count = new AtomicInteger (1 )
79- val indexToTerminal = sortedGroups.keys().toArray
79+ val indexToTerminal = plan. sortedGroups.keys().toArray
8080
8181 EvaluatorLogs .logDependencyTree(interGroupDeps, indexToTerminal, outPath)
8282
8383 // Prepare a lookup tables up front of all the method names that each class owns,
8484 // and the class hierarchy, so during evaluation it is cheap to look up what class
8585 // each target belongs to determine of the enclosing class code signature changed.
8686 val (classToTransitiveClasses, allTransitiveClassMethods) =
87- CodeSigUtils .precomputeMethodNamesPerClass(sortedGroups )
87+ CodeSigUtils .precomputeMethodNamesPerClass(Plan .transitiveNamed(goals) )
8888
8989 val uncached = new ConcurrentHashMap [Terminal , Unit ]()
9090 val changedValueHash = new ConcurrentHashMap [Terminal , Unit ]()
@@ -106,7 +106,7 @@ private[mill] trait EvaluatorCore extends GroupEvaluator {
106106 for (terminal <- terminals) {
107107 val deps = interGroupDeps(terminal)
108108
109- val group = sortedGroups.lookupKey(terminal)
109+ val group = plan. sortedGroups.lookupKey(terminal)
110110 val exclusiveDeps = deps.filter(d => d.task.isExclusiveCommand)
111111
112112 if (! terminal.task.isExclusiveCommand && exclusiveDeps.nonEmpty) {
@@ -162,7 +162,7 @@ private[mill] trait EvaluatorCore extends GroupEvaluator {
162162
163163 val res = evaluateGroupCached(
164164 terminal = terminal,
165- group = sortedGroups.lookupKey(terminal),
165+ group = plan. sortedGroups.lookupKey(terminal),
166166 results = upstreamResults,
167167 countMsg = countMsg,
168168 verboseKeySuffix = verboseKeySuffix,
@@ -205,15 +205,13 @@ private[mill] trait EvaluatorCore extends GroupEvaluator {
205205 }
206206
207207 val tasks0 = terminals0.filter {
208- case Terminal .Labelled (c : Command [_], _ ) => false
208+ case Terminal .Labelled (c : Command [_]) => false
209209 case _ => true
210210 }
211211
212- val (_, tasksTransitive0) = Plan .plan(Agg .from(tasks0.map(_.task)))
213-
214- val tasksTransitive = tasksTransitive0.toSet
212+ val tasksTransitive = Plan .transitiveTargets(Agg .from(tasks0.map(_.task))).toSet
215213 val (tasks, leafExclusiveCommands) = terminals0.partition {
216- case Terminal .Labelled (t, _ ) => tasksTransitive.contains(t) || ! t.isExclusiveCommand
214+ case Terminal .Labelled (t) => tasksTransitive.contains(t) || ! t.isExclusiveCommand
217215 case _ => ! serialCommandExec
218216 }
219217
@@ -237,7 +235,7 @@ private[mill] trait EvaluatorCore extends GroupEvaluator {
237235
238236 val results0 : Vector [(Task [_], TaskResult [(Val , Int )])] = terminals0
239237 .flatMap { t =>
240- sortedGroups.lookupKey(t).flatMap { t0 =>
238+ plan. sortedGroups.lookupKey(t).flatMap { t0 =>
241239 finishedOptsMap(t) match {
242240 case None => Some ((t0, TaskResult (Aborted , () => Aborted )))
243241 case Some (res) => res.newResults.get(t0).map(r => (t0, r))
@@ -255,8 +253,8 @@ private[mill] trait EvaluatorCore extends GroupEvaluator {
255253 Strict .Agg .from(
256254 finishedOptsMap.values.flatMap(_.toSeq.flatMap(_.newEvaluated)).iterator.distinct
257255 ),
258- transitive,
259- getFailing(sortedGroups, results),
256+ plan. transitive,
257+ getFailing(plan. sortedGroups, results),
260258 results.map { case (k, v) => (k, v.map(_._1)) }
261259 )
262260 }
0 commit comments