MainModule

mill.util.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 RootModule0
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.

Both src and dest can resolve to multiple tasks (e.g. via glob patterns), and a path will be found from any task matching src to any task matching dest.

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 updateMillScripts(version: String, shellScriptPath: String = ..., batScriptPath: String = ...): Command[Seq[PathRef]]

Update the Mill bootstrap scripts (./mill and ./mill.bat) in the project to the specified version. Downloads the scripts from Maven Central and sets executable permissions on the Unix script.

Update the Mill bootstrap scripts (./mill and ./mill.bat) in the project to the specified version. Downloads the scripts from Maven Central and sets executable permissions on the Unix script.

You can also manually select the scripts to update, in which case only the specified script will be installed.

Value parameters

batScriptPath

Override the location of the Windows batch script.

shellScriptPath

Override the location of the shell script, e.g "~/bin/mill".

version

The Mill version to update to (e.g., "1.1.0")

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

def javaRun(args: String*): Command[Unit]

Runs the java command from Mill's JVM

Runs the java command from Mill's JVM

Attributes

Inherited from:
JdkCommandsModule
Source
JdkCommandsModule.scala
def javac(args: String*): Command[Unit]

Runs the javac command from Mill's JVM

Runs the javac command from Mill's JVM

Attributes

Inherited from:
JdkCommandsModule
Source
JdkCommandsModule.scala
def javap(args: String*): Command[Unit]

Runs the javap command from Mill's JVM

Runs the javap command from Mill's JVM

Attributes

Inherited from:
JdkCommandsModule
Source
JdkCommandsModule.scala

The Java home to use for JDK commands. If None, uses the default JDK (typically the one running Mill).

The Java home to use for JDK commands. If None, uses the default JDK (typically the one running Mill).

Attributes

Inherited from:
JdkCommandsModule
Source
JdkCommandsModule.scala
def jfr(args: String*): Command[Unit]

Runs the jfr command from Mill's JVM

Runs the jfr command from Mill's JVM

Attributes

Inherited from:
JdkCommandsModule
Source
JdkCommandsModule.scala
def jps(args: String*): Command[Unit]

Runs the jps command from Mill's JVM

Runs the jps command from Mill's JVM

Attributes

Inherited from:
JdkCommandsModule
Source
JdkCommandsModule.scala
def jstack(args: String*): Command[Unit]

Runs the jstack command from Mill's JVM

Runs the jstack command from Mill's JVM

Attributes

Inherited from:
JdkCommandsModule
Source
JdkCommandsModule.scala

Attributes

Inherited from:
RootModule0
Source
RootModule0.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

Inherited and Abstract methods

Attributes

Inherited from:
RootModule0
Source
RootModule0.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