MillBuildBootstrap

mill.daemon.MillBuildBootstrap
See theMillBuildBootstrap companion object
class MillBuildBootstrap(projectRoot: Path, output: Path, keepGoing: Boolean, imports: Seq[String], env: Map[String, String], ec: Option[ThreadPoolExecutor], tasksAndParams: Seq[String], prevRunnerState: RunnerState, logger: Logger, needBuildFile: Boolean, requestedMetaLevel: Option[Int], allowPositionalCommandArgs: Boolean, systemExit: StopServer, streams0: SystemStreams, selectiveExecution: Boolean, offline: Boolean, reporter: EvaluatorApi => Int => Option[CompileProblemReporter], skipSelectiveExecution: Boolean, enableTicker: Boolean)

Logic around bootstrapping Mill, creating a MillBuildRootModule.BootstrapModule and compiling builds/meta-builds and classloading their RootModules so we can evaluate the requested tasks on the RootModule representing the user's build.mill file.

When Mill is run in client-server mode, or with --watch, then data from each evaluation is cached in-memory in prevRunnerState.

When a subsequent evaluation happens, each level of evaluateRec uses its corresponding frame from prevRunnerState to avoid work, re-using classloaders or workers to avoid running expensive classloading or re-evaluation. This should be transparent, improving performance without affecting behavior.

Attributes

Companion
object
Source
MillBuildBootstrap.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def evaluateRec(depth: Int): RunnerState

Attributes

Source
MillBuildBootstrap.scala
def processFinalTasks(nestedState: RunnerState, buildFileApi: BuildFileApi, evaluator: EvaluatorApi): RunnerState

Handles the final evaluation of the user-provided tasks. Since there are no further levels to evaluate, we do not need to save a scriptImportGraph, classloader, or runClasspath.

Handles the final evaluation of the user-provided tasks. Since there are no further levels to evaluate, we do not need to save a scriptImportGraph, classloader, or runClasspath.

Attributes

Source
MillBuildBootstrap.scala
def processRunClasspath(nestedState: RunnerState, buildFileApi: BuildFileApi, evaluator: EvaluatorApi, prevFrameOpt: Option[Frame], prevOuterFrameOpt: Option[Frame], depth: Int): RunnerState

Handles the compilation of build.mill or one of the meta-builds. These cases all only need us to run evaluate runClasspath and scriptImportGraph to instantiate their classloader/RootModule to feed into the next level's Evaluator.

Handles the compilation of build.mill or one of the meta-builds. These cases all only need us to run evaluate runClasspath and scriptImportGraph to instantiate their classloader/RootModule to feed into the next level's Evaluator.

Note that if the runClasspath doesn't change, we re-use the previous classloader, saving us from having to re-instantiate it and for the code inside to be re-JITed

Attributes

Source
MillBuildBootstrap.scala

Concrete fields

val millBootClasspath: Seq[Path]

Attributes

Source
MillBuildBootstrap.scala