Attributes
- Companion
- class
- Source
- Task.scala
- Graph
-
- Supertypes
- Self type
-
Task.type
Members list
Type members
Classlikes
Attributes
- Source
- Task.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Source
- Task.scala
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Source
- Task.scala
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class Task[T]class AnonImpl[T]trait NamedTask[T]class Command[T]trait Target[T]class InputImpl[T]class SourceImplclass SourcesImplclass TargetImpl[T]class Worker[T]Show all
- Self type
-
Task[T]
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 NamedTasks defined using def foo() = Task.Command{...}
and are typically called from the command-line. Unlike other NamedTasks, 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 NamedTasks defined using def foo() = Task.Command{...}
and are typically called from the command-line. Unlike other NamedTasks, 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.
Attributes
- Source
- Task.scala
InputImpls, normally defined using Task.Input
, are NamedTasks that re-evaluate every time Mill is run. This is in contrast to TargetImpls which only re-evaluate when upstream tasks change.
InputImpls, normally defined using Task.Input
, are NamedTasks that re-evaluate every time Mill is run. This is in contrast to TargetImpls which only re-evaluate when upstream tasks change.
InputImpls 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{...}
TargetImpl 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 TargetImpls
The most common case of InputImpl is SourceImpl and SourcesImpl, 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 InputImpl defined via Task.Sources
, SourcesImpl uses PathRefs to compute a signature for a set of source files and folders.
A specialization of InputImpl defined via Task.Sources
, SourcesImpl 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 TargetImpls need to be invalidated and re-computed.
Attributes
- Source
- Task.scala
Attributes
- Source
- Task.scala
Worker is a NamedTask 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 MillServerMain
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 NamedTask 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 MillServerMain
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 TargetImpl 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 TargetImpl 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
Inherited methods
Returns the implicit mill.api.Ctx.Args.args in scope.
Returns the implicit mill.api.Ctx.Args.args in scope.
Attributes
- Inherited from:
- TaskBase
- Source
- Task.scala
Returns the mill.api.Ctx that is available within this task
Returns the mill.api.Ctx that is available within this task
Attributes
- Inherited from:
- TaskBase
- Source
- Task.scala
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
- Inherited from:
- TaskBase
- 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
- Inherited from:
- TaskBase
- 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
- Inherited from:
- TaskBase
- 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
- Inherited from:
- TaskBase
- Source
- Task.scala
Report build results to BSP for IDE integration
Report build results to BSP for IDE integration
Attributes
- Inherited from:
- TaskBase
- Source
- Task.scala
Converts a Seq[Task[T]]
into a Task[Seq[T]]
Report test results to BSP for IDE integration
Report test results to BSP for IDE integration
Attributes
- Inherited from:
- TaskBase
- Source
- Task.scala
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]
Attributes
- Inherited from:
- TaskBase
- Source
- Task.scala
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
- Inherited from:
- TaskBase
- Source
- Task.scala