MainModule

mill.main.MainModule
See theMainModule companion object

mill.api.Module containing all the default tasks that Mill provides: resolve, show, inspect, plan, etc.

Attributes

Companion
object
Source
MainModule.scala
Graph
Supertypes
class BaseModule
trait Module
trait ModuleApi
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Type members

Inherited classlikes

object moduleInternal extends Internal

Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill

Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill

Attributes

Inherited from:
Module
Source
Module.scala
Supertypes
class Internal
class Object
trait Matchable
class Any

Value members

Concrete methods

def clean(evaluator: Evaluator, tasks: String*): Command[Seq[PathRef]]

Deletes the given targets from the out directory. Providing no targets will clean everything.

Deletes the given targets from the out directory. Providing no targets will clean everything.

Attributes

Source
MainModule.scala
def cleanTask(evaluator: Evaluator, tasks: String*): Task[Seq[PathRef]]

Attributes

Source
MainModule.scala
def init(evaluator: Evaluator, args: String*): Command[Unit]

The init allows you to quickly generate a starter project.

The init allows you to quickly generate a starter project.

If you run it without arguments, it displays the list of available examples.

If you pass one of listed examples, it downloads specified example from mill releases page and extracts it to working directory.

If you pass a g8 template, it will generate a project based on a Giter8 template. It prompts you to enter project name and creates a folder with that name. There are lots of templates out there for many frameworks and tools!

Attributes

Source
MainModule.scala
def inspect(evaluator: Evaluator, tasks: String*): Command[String]

Displays metadata about the given task without actually running it.

Displays metadata about the given task without actually running it.

Attributes

Source
MainModule.scala
def path(evaluator: Evaluator, src: String, dest: String): Command[List[String]]

Prints out some dependency path from the src task to the dest task.

Prints out some dependency path from the src task to the dest task.

If there are multiple dependency paths between src and dest, the path chosen is arbitrary.

Attributes

Source
MainModule.scala
def plan(evaluator: Evaluator, tasks: String*): Command[Array[String]]

Given a set of tasks, prints out the execution plan of what tasks will be executed in what order, without actually executing them.

Given a set of tasks, prints out the execution plan of what tasks will be executed in what order, without actually executing them.

Attributes

Source
MainModule.scala
def resolve(evaluator: Evaluator, tasks: String*): Command[List[String]]

Resolves a mill query string and prints out the tasks it resolves to.

Resolves a mill query string and prints out the tasks it resolves to.

Attributes

Source
MainModule.scala
def show(evaluator: Evaluator, tasks: String*): Command[Value]

Runs a given task and prints the JSON result to stdout. This is useful to integrate Mill into external scripts and tooling.

Runs a given task and prints the JSON result to stdout. This is useful to integrate Mill into external scripts and tooling.

Attributes

Source
MainModule.scala
def showNamed(evaluator: Evaluator, tasks: String*): Command[Value]

Runs a given task and prints the results as JSON dictionary to stdout. This is useful to integrate Mill into external scripts and tooling.

Runs a given task and prints the results as JSON dictionary to stdout. This is useful to integrate Mill into external scripts and tooling.

Attributes

Source
MainModule.scala
def shutdown(): Command[Unit]

Shuts down mill's background daemon

Shuts down mill's background daemon

Attributes

Source
MainModule.scala
def version(): Command[String]

Show the mill version.

Show the mill version.

Attributes

Source
MainModule.scala
def visualize(evaluator: Evaluator, tasks: String*): Command[Seq[PathRef]]

Renders the dependencies between the given tasks as a SVG for you to look at

Renders the dependencies between the given tasks as a SVG for you to look at

Attributes

Source
MainModule.scala
def visualizePlan(evaluator: Evaluator, tasks: String*): Command[Seq[PathRef]]

Renders the dependencies between the given tasks, and all their dependencies, as a SVG

Renders the dependencies between the given tasks, and all their dependencies, as a SVG

Attributes

Source
MainModule.scala

Inherited methods

Attributes

Inherited from:
BaseModule
Source
BaseModule.scala
def moduleDir: Path

Attributes

Inherited from:
Module
Source
Module.scala

Attributes

Inherited from:
Module
Source
Module.scala

Attributes

Inherited from:
Module
Source
Module.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Module -> Any
Inherited from:
Module
Source
Module.scala

Concrete fields

Commands related to selective execution, where Mill runs tasks selectively depending on what task inputs or implementations changed.

Commands related to selective execution, where Mill runs tasks selectively depending on what task inputs or implementations changed.

Read more about it at: https://mill-build.org/mill/large/selective-execution.html

Here are the essential commands:

  • mill selective.prepare <selector>: run on the codebase before the code change, stores a snapshot of task inputs and implementations

  • mill selective.run <selector>: run on the codebase after the code change, runs tasks in the given <selector> which are affected by the code changes that have happened since selective.prepare was run

  • mill selective.resolve <selector>: a dry-run version of selective.run, prints out the tasks in <selector> that are affected by the code changes and would have run, without actually running them.

Attributes

Source
MainModule.scala