class Ctx extends Dest with Log with api.Ctx.Args with Home with Env with Workspace
Represents the data and utilities that are contextually available inside the
implementation of a Task
.
- Source
- Ctx.scala
- Alphabetic
- By Inheritance
- Ctx
- Workspace
- Env
- Home
- Args
- Log
- Dest
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Ctx(args: IndexedSeq[_], dest0: () => Path, log: Logger, home: Path, env: Map[String, String], reporter: (Int) => Option[CompileProblemReporter], testReporter: TestReporter, workspace: Path)
- new Ctx(args: IndexedSeq[_], dest0: () => Path, log: Logger, home: Path, env: Map[String, String], reporter: (Int) => Option[CompileProblemReporter], testReporter: TestReporter, workspace: Path, systemExit: (Int) => Nothing)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def arg[T](index: Int): T
- val args: IndexedSeq[_]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def dest: Path
T.dest
is a uniqueos.Path
(e.g.T.dest
is a uniqueos.Path
(e.g.out/classFiles.dest/
orout/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. - val env: Map[String, String]
T.env
is the environment variable map passed to the Mill command when it is run; typically used inside aTask.Input
to ensure any changes in the env vars are properly detected.T.env
is the environment variable map passed to the Mill command when it is run; typically used inside aTask.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 thatsys.env
variables may not be up to date. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val home: Path
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val log: Logger
T.log
is the default logger provided for every task.T.log
is the default logger provided for every task. While your task is running,System.out
andSystem.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
orout/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. - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- val reporter: (Int) => Option[CompileProblemReporter]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val systemExit: (Int) => Nothing
- val testReporter: TestReporter
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- val workspace: 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).
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)