Attributes
- Companion
- class
- Source
- Task.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Task.type
Members list
Type members
Classlikes
Attributes
- Source
- Task.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Source
- Task.scala
- Supertypes
Attributes
- Source
- Task.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Source
- Task.scala
- Supertypes
Represents a task that can be referenced by its path segments. Task{...}
targets, 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{...}
targets, Task.Input
, Task.Worker
, etc. but not including anonymous Task.Anon
or Task.traverse
etc. instances
Attributes
- Source
- Task.scala
- Supertypes
- Known subtypes
Attributes
- Companion
- trait
- Source
- Task.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Simple.type
A Target is a Task.Named that is cached on disk; either a Task.Computed or an Input
A Target is a Task.Named that is cached on disk; either a Task.Computed or an Input
Attributes
- Companion
- object
- Source
- Task.scala
- Supertypes
- Known subtypes
Attributes
- Source
- Task.scala
- Supertypes
Attributes
- Source
- Task.scala
- Supertypes
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{...}
targets.
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{...}
targets.
Attributes
- Source
- Task.scala
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
- Source
- Task.scala
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
- Source
- Task.scala
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
- Source
- Task.scala
Similar to Sources, but only for a single source file or folder. Defined using Task.Source
.
Similar to Sources, but only for a single source file or folder. Defined using Task.Source
.
Attributes
- Source
- Task.scala
Attributes
- Source
- Task.scala
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
- Source
- Task.scala
Attributes
- Source
- Task.scala
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
- Source
- Task.scala
Attributes
- Source
- Task.scala
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
- Source
- Task.scala
Returns the implicit mill.define.TaskCtx.Args.args in scope.
Returns the mill.define.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 Target 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 Target 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 Target 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 Target or Command, so you can be sure that you will not collide or interfere with anyone else writing to those same paths.
Attributes
- Source
- Task.scala
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
- Source
- Task.scala
Attributes
- Source
- Task.scala
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
- Source
- Task.scala
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
- Source
- Task.scala
Attributes
- Source
- Task.scala
Report build results to BSP for IDE integration
Converts a Seq[Task[T]]
into a Task[Seq[T]]
Report test results to BSP for IDE integration
Converts a Seq[T]
into a Task[Seq[V]]
using the given f: T => Task[V]
This is the os.Path
pointing to the project root directory.
This is the os.Path
pointing to the project root directory.
This is the preferred access to the project directory, and should always be prefered over os.pwd
* (which might also point to the project directory in classic cli scenarios, but might not in other use cases like BSP or LSP server usage).
Attributes
- Source
- Task.scala