TaskBase

mill.define.TaskBase
@Scaladoc(value = "/**\n * The [[mill.define.Target]] companion object, usually aliased as [[T]],\n * provides most of the helper methods and macros used to build task graphs.\n * methods like `Task.`[[apply]], `Task.`[[sources]], `Task.`[[command]] allow you to\n * define the tasks, while methods like `Task.`[[dest]], `Task.`[[log]] or\n * `Task.`[[env]] provide the core APIs that are provided to a task implementation\n */")
class TaskBase

The mill.define.Target companion object, usually aliased as T, provides most of the helper methods and macros used to build task graphs. methods like Task.apply, Task.sources, Task.command allow you to define the tasks, while methods like Task.dest, Task.log or Task.env provide the core APIs that are provided to a task implementation

Attributes

Source
Task.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Target
object Task

Members list

Value members

Concrete methods

@Scaladoc(value = "/**\n * Returns the implicit [[mill.api.Ctx.Args.args]] in scope.\n */")
def args(implicit ctx: Args): IndexedSeq[_]

Returns the implicit mill.api.Ctx.Args.args in scope.

Returns the implicit mill.api.Ctx.Args.args in scope.

Attributes

Source
Task.scala
@Scaladoc(value = "/**\n * Returns the [[mill.api.Ctx]] that is available within this task\n */")
def ctx()(implicit c: Ctx): Ctx

Returns the mill.api.Ctx that is available within this task

Returns the mill.api.Ctx that is available within this task

Attributes

Source
Task.scala
@Scaladoc(value = "/**\n * `Task.dest` is a unique `os.Path` (e.g. `out/classFiles.dest/` or `out/run.dest/`)\n * that is assigned to every Target or Command. It is cleared before your\n * task runs, and you can use it as a scratch space for temporary files or\n * a place to put returned artifacts. This is guaranteed to be unique for\n * every Target or Command, so you can be sure that you will not collide or\n * interfere with anyone else writing to those same paths.\n */")
def dest(implicit ctx: Dest): Path

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
@Scaladoc(value = "/**\n * `Task.env` is the environment variable map passed to the Mill command when\n * it is run; typically used inside a `Task.Input` to ensure any changes in\n * the env vars are properly detected.\n *\n * Note that you should not use `sys.env`, as Mill\'s long-lived server\n * process means that `sys.env` variables may not be up to date.\n */")
def env(implicit ctx: Env): Map[String, String]

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
@Scaladoc(value = "/**\n * Provides the `.fork.async` and `.fork.await` APIs for spawning and joining\n * async futures within your task in a Mill-friendly mannter\n */")
def fork(implicit ctx: Ctx): Api

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
@Scaladoc(value = "/**\n * Returns the implicit [[mill.api.Ctx.Home.home]] in scope.\n */")
def home(implicit ctx: Home): Path

Returns the implicit mill.api.Ctx.Home.home in scope.

Returns the implicit mill.api.Ctx.Home.home in scope.

Attributes

Source
Task.scala
@Scaladoc(value = "/**\n * `Task.log` is the default logger provided for every task. While your task is running,\n * `System.out` and `System.in` are also redirected to this logger. The logs for a\n * task are streamed to standard out/error as you would expect, but each task\'s\n * specific output is also streamed to a log file on disk, e.g. `out/run.log` or\n * `out/classFiles.log` for you to inspect later.\n *\n * Messages logged with `log.debug` appear by default only in the log files.\n * You can use the `--debug` option when running mill to show them on the console too.\n */")
def log(implicit ctx: Log): Logger

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
@Scaladoc(value = "/**\n * Report build results to BSP for IDE integration\n */")
def reporter(implicit ctx: Ctx): Int => Option[CompileProblemReporter]

Report build results to BSP for IDE integration

Report build results to BSP for IDE integration

Attributes

Source
Task.scala
@Scaladoc(value = "/**\n * Converts a `Seq[Task[T]]` into a `Task[Seq[T]]`\n */")
def sequence[T](source: Seq[Task[T]]): Task[Seq[T]]

Converts a Seq[Task[T]] into a Task[Seq[T]]

Converts a Seq[Task[T]] into a Task[Seq[T]]

Attributes

Source
Task.scala
@Scaladoc(value = "/**\n * Report test results to BSP for IDE integration\n */")
def testReporter(implicit ctx: Ctx): TestReporter

Report test results to BSP for IDE integration

Report test results to BSP for IDE integration

Attributes

Source
Task.scala
@Scaladoc(value = "/**\n * Converts a `Seq[T]` into a `Task[Seq[V]]` using the given `f: T => Task[V]`\n */")
def traverse[T, V](source: Seq[T])(f: T => Task[V]): Task[Seq[V]]

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

Source
Task.scala
@Scaladoc(value = "/**\n * This is the `os.Path` pointing to the project root directory.\n *\n * This is the preferred access to the project directory, and should\n * always be prefered over `os.pwd`* (which might also point to the\n * project directory in classic cli scenarios, but might not in other\n * use cases like BSP or LSP server usage).\n */")
def workspace(implicit ctx: Ctx): Path

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