Attributes
Members list
Type members
Classlikes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Represents a task that can be referenced by its path segments. Task{...}
tasks, Task.Input
, Task.Worker
, etc. but not including anonymous Task.Anon
or Task.traverse
etc. instances
Represents a task that can be referenced by its path segments. Task{...}
tasks, Task.Input
, Task.Worker
, etc. but not including anonymous Task.Anon
or Task.traverse
etc. instances
Attributes
- Supertypes
- Known subtypes
A Simple Task is a Task.Named that is cached on disk; either a Task.Computed or an Input
A Simple Task is a Task.Named that is cached on disk; either a Task.Computed or an Input
Attributes
- Companion
- object
- Supertypes
- Known subtypes
Value members
Concrete methods
Creates an anonymous Task
. These depend on other tasks and be-depended-upon by other tasks, but cannot be run directly from the command line and do not perform any caching. Typically used as helpers to implement Task{...}
tasks.
Creates an anonymous Task
. These depend on other tasks and be-depended-upon by other tasks, but cannot be run directly from the command line and do not perform any caching. Typically used as helpers to implement Task{...}
tasks.
Attributes
Commands are only Task.Nameds defined using def foo() = Task.Command{...}
and are typically called from the command-line. Unlike other Task.Nameds, Commands can be defined to take arguments that are automatically converted to command-line arguments, as long as an implicit mainargs.TokensReader is available.
Commands are only Task.Nameds defined using def foo() = Task.Command{...}
and are typically called from the command-line. Unlike other Task.Nameds, Commands can be defined to take arguments that are automatically converted to command-line arguments, as long as an implicit mainargs.TokensReader is available.
Attributes
Value parameters
- exclusive
-
Exclusive commands run serially at the end of an evaluation, without any other tasks running parallel, and without the terminal logging prefixes that are applied to normal tasks. These are normally used for "top level" commands which are run directly to perform some action or display some output to the user.
- persistent
-
If true the
Task.dest
directory is not cleaned between runs.
Attributes
Inputs, normally defined using Task.Input
, are Task.Nameds that re-evaluate every time Mill is run. This is in contrast to Task.Computeds which only re-evaluate when upstream tasks change.
Inputs, normally defined using Task.Input
, are Task.Nameds that re-evaluate every time Mill is run. This is in contrast to Task.Computeds which only re-evaluate when upstream tasks change.
Inputs are useful when you want to capture some input to the Mill build graph that comes from outside: maybe from an environment variable, a JVM system property, the hash returned by git rev-parse HEAD
. Reading these external mutable variables inside a Task{...}
Task.Computed will incorrectly cache them forever. Reading them inside a Task.Input{...}
will re-compute them every time, and only if the value changes would it continue to invalidate downstream Task.Computeds
The most common case of Input is Source and Sources, used for detecting changes to source files.
Attributes
A specialization of Input defined via Task.Sources
, Sources uses PathRefs to compute a signature for a set of source files and folders.
A specialization of Input defined via Task.Sources
, Sources uses PathRefs to compute a signature for a set of source files and folders.
This is most used when detecting changes in source code: when you edit a file and run mill compile
, it is the Task.Sources
that re-computes the signature for you source files/folders and decides whether or not downstream Task.Computeds need to be invalidated and re-computed.
Attributes
Worker is a Task.Named that lives entirely in-memory, defined using Task.Worker{...}
. The value returned by Task.Worker{...}
is long-lived, persisting as long as the Mill process is kept alive (e.g. via --watch
, or via its default MillDaemonMain
server process). This allows the user to perform in-memory caching that is even more aggressive than the disk-based caching enabled by PersistentImpl: your Worker can cache running sub-processes, JVM Classloaders with JITed code, and all sorts of things that do not easily serialize to JSON on disk.
Worker is a Task.Named that lives entirely in-memory, defined using Task.Worker{...}
. The value returned by Task.Worker{...}
is long-lived, persisting as long as the Mill process is kept alive (e.g. via --watch
, or via its default MillDaemonMain
server process). This allows the user to perform in-memory caching that is even more aggressive than the disk-based caching enabled by PersistentImpl: your Worker can cache running sub-processes, JVM Classloaders with JITed code, and all sorts of things that do not easily serialize to JSON on disk.
Like PersistentImpl, The user defining a Worker assumes the responsibility of ensuring the implementation is idempotent regardless of what in-memory state the worker may have.
Attributes
Persistent tasks are defined using the Task(persistent = true){...}
syntax. The main difference is that while Task.Computed deletes the Task.dest
folder in between runs, PersistentImpl preserves it. This lets the user make use of files on disk that persistent between runs of the task, e.g. to implement their own fine-grained caching beyond what Mill provides by default.
Persistent tasks are defined using the Task(persistent = true){...}
syntax. The main difference is that while Task.Computed deletes the Task.dest
folder in between runs, PersistentImpl preserves it. This lets the user make use of files on disk that persistent between runs of the task, e.g. to implement their own fine-grained caching beyond what Mill provides by default.
Note that the user defining a Task(persistent = true)
task is taking on the responsibility of ensuring that their implementation is idempotent, i.e. that it computes the same result whether or not there is data in Task.dest
. Violating that invariant can result in confusing mis-behaviors
Attributes
Returns the implicit mill.api.TaskCtx.Args.args in scope.
Returns the mill.api.TaskCtx that is available within this task
Task.dest
is a unique os.Path
(e.g. out/classFiles.dest/
or out/run.dest/
) that is assigned to every Task or Command. It is cleared before your task runs, and you can use it as a scratch space for temporary files or a place to put returned artifacts. This is guaranteed to be unique for every Task or Command, so you can be sure that you will not collide or interfere with anyone else writing to those same paths.
Task.dest
is a unique os.Path
(e.g. out/classFiles.dest/
or out/run.dest/
) that is assigned to every Task or Command. It is cleared before your task runs, and you can use it as a scratch space for temporary files or a place to put returned artifacts. This is guaranteed to be unique for every Task or Command, so you can be sure that you will not collide or interfere with anyone else writing to those same paths.
Attributes
Task.env
is the environment variable map passed to the Mill command when it is run; typically used inside a Task.Input
to ensure any changes in the env vars are properly detected.
Task.env
is the environment variable map passed to the Mill command when it is run; typically used inside a Task.Input
to ensure any changes in the env vars are properly detected.
Note that you should not use sys.env
, as Mill's long-lived server process means that sys.env
variables may not be up to date.
Attributes
Provides the .fork.async
and .fork.await
APIs for spawning and joining async futures within your task in a Mill-friendly mannter
Provides the .fork.async
and .fork.await
APIs for spawning and joining async futures within your task in a Mill-friendly mannter
Attributes
Task.log
is the default logger provided for every task. While your task is running, System.out
and System.in
are also redirected to this logger. The logs for a task are streamed to standard out/error as you would expect, but each task's specific output is also streamed to a log file on disk, e.g. out/run.log
or out/classFiles.log
for you to inspect later.
Task.log
is the default logger provided for every task. While your task is running, System.out
and System.in
are also redirected to this logger. The logs for a task are streamed to standard out/error as you would expect, but each task's specific output is also streamed to a log file on disk, e.g. out/run.log
or out/classFiles.log
for you to inspect later.
Messages logged with log.debug
appear by default only in the log files. You can use the --debug
option when running mill to show them on the console too.
Attributes
Report build results to BSP for IDE integration
Report build results to BSP for IDE integration
Attributes
Converts a Seq[Task[T]]
into a Task[Seq[T]]
Converts a Seq[Task[T]]
into a Task[Seq[T]]
Attributes
Report test results to BSP for IDE integration
Report test results to BSP for IDE integration
Attributes
Converts a Seq[T]
into a Task[Seq[V]]
using the given f: T => Task[V]
Converts a Seq[T]
into a Task[Seq[V]]
using the given f: T => Task[V]