You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/modules/ROOT/pages/extending/evaluator.adoc
+22-1Lines changed: 22 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
= Evaluator API Commands
2
2
3
+
The Mill `Evaluator` API provides programmatic access to Mill's core functionalities, allowing you to resolve, plan, and execute build tasks directly.
4
+
This API is essential for extending Mill built-in features through interaction and control of the build process.
5
+
3
6
== `resolveSegments`
4
7
5
8
Resolves a sequence of Mill selector strings (such as task or module names) into a list of fully-qualified segment paths matching tasks or modules in the build.
@@ -13,6 +16,10 @@ Resolves a sequence of Mill selector strings (such as task or module names) into
13
16
=== Returns:
14
17
- `mill.api.Result[List[Segments]]` - A result wrapping the list of resolved segment paths (`Segments`).
15
18
19
+
=== Use Case:
20
+
Use this when you want to resolve a list of query selector into a list of `mill.api.Segments`.
21
+
`Segments` represent the "path" or selector for tasks or modules, but not the tasks themselves.
@@ -44,7 +55,10 @@ Computes and returns the execution plan (ordered task list) for a set of resolve
44
55
- `tasks: Seq[Task.Named[?]]` - List of tasks to plan.
45
56
46
57
=== Returns:
47
-
- `Plan` - A type with execution plan details (including all transitive tasks and their sorted grouping).
58
+
- `Plan` - An object containing execution plan details (including all transitive tasks and their sorted grouping).
59
+
60
+
=== Use Case:
61
+
Use this when you need to inspect the sequence of tasks Mill would execute for a given set of targets, without actually performing the execution. This is useful for debugging or understanding dependencies.
48
62
49
63
=== Example Usage:
50
64
@@ -66,6 +80,10 @@ Executes a list of tasks and returns the results of their evaluation.
66
80
=== Returns:
67
81
- `Evaluator.Result[T]` - Contains results of tasks executed, any watched files, and success/failure info for each task.
68
82
83
+
=== Use Case:
84
+
Choose `execute` when you needs to programmatically run one or more specific Mill tasks and you require access to their execution results, such as the output values, or success/failure status.
85
+
This is central for implementing conditional build logic, integrating with external tools, or collecting custom build metrics after tasks have completed.
0 commit comments