PathAliasing

mill.api.internal.PathAliasing
object PathAliasing

Attributes

Source
PathAliasing.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def aliasMappingForCwd(cwd: Path, workspace: Path = ...): Seq[(Path, RelPath)]

Attributes

Source
PathAliasing.scala
def defaultMapping(workspace: Path): Seq[(Path, RelPath)]

The standard Mill (abs, alias) mappings (workspace -> ../mill-workspace, home -> ../mill-home) used by ensureProcessCwdAliases to install the ../mill-workspace / ../mill-home forwarder symlinks.

The standard Mill (abs, alias) mappings (workspace -> ../mill-workspace, home -> ../mill-home) used by ensureProcessCwdAliases to install the ../mill-workspace / ../mill-home forwarder symlinks.

Attributes

Source
PathAliasing.scala
def ensureProcessCwdAliases(cwd: Path, workspace: => Path = ...): Unit

Install the mill-workspace / mill-home forwarder symlinks for a process whose cwd is cwd. The aliases live outside the cwd, normally in its parent. That keeps tools which walk/archive their own working directory (jar -c ., tar, os.walk) from seeing aliases while still letting subprocess cwd values resolve paths like ../mill-workspace/....

Install the mill-workspace / mill-home forwarder symlinks for a process whose cwd is cwd. The aliases live outside the cwd, normally in its parent. That keeps tools which walk/archive their own working directory (jar -c ., tar, os.walk) from seeing aliases while still letting subprocess cwd values resolve paths like ../mill-workspace/....

The exception is a subprocess spawned directly at the workspace root. In that case, the path relativizer needs aliases under the configured Mill output directory, so put the forwarders there instead of outside the workspace.

Attributes

Source
PathAliasing.scala
def pathRelativizerBaseForCwd(cwd: Path, workspace: Path = ...): String

Attributes

Source
PathAliasing.scala
def withDefaultPathSerializer[T](body: => T): T

Scope body so the os.Path serializer is the default (env-driven) one. Used by long-running in-process tools whose own output should not inherit an outer caller's custom serializer.

Scope body so the os.Path serializer is the default (env-driven) one. Used by long-running in-process tools whose own output should not inherit an outer caller's custom serializer.

Attributes

Source
PathAliasing.scala
def withRawPathSerializer[T](body: => T): T

Scope body so os-lib's ProcessBuilder inputs (cwd, stdout/stderr redirects) use real on-disk paths. Keep this narrow: ordinary user-facing path strings should go through PathRef.

Scope body so os-lib's ProcessBuilder inputs (cwd, stdout/stderr redirects) use real on-disk paths. Keep this narrow: ordinary user-facing path strings should go through PathRef.

Attributes

Source
PathAliasing.scala
def withSpawnAliasHook[T](workspace: Path)(body: => T): T

Run body with an os.ProcessOps.spawnHook installed that ensures every subprocess's cwd has the ../mill-workspace/../mill-home aliases. Chains onto any existing hook so installations from outer scopes (e.g. EvaluatorImpl) still run.

Run body with an os.ProcessOps.spawnHook installed that ensures every subprocess's cwd has the ../mill-workspace/../mill-home aliases. Chains onto any existing hook so installations from outer scopes (e.g. EvaluatorImpl) still run.

Attributes

Source
PathAliasing.scala
def workspaceEnvVars(workspace: Path = ...): Map[String, String]

The env vars a Mill subprocess needs to participate in path relativization: the workspace root (so it can locate out/), and the os-lib relativizer base (so its serialized paths round-trip through the same aliases the daemon uses).

The env vars a Mill subprocess needs to participate in path relativization: the workspace root (so it can locate out/), and the os-lib relativizer base (so its serialized paths round-trip through the same aliases the daemon uses).

Attributes

Source
PathAliasing.scala
def workspaceEnvVarsForCwd(cwd: Path, workspace: Path = ...): Map[String, String]

Attributes

Source
PathAliasing.scala
def workspaceRootPathRelativizerBase(workspace: Path = ...): String

Attributes

Source
PathAliasing.scala

Concrete fields

val homeAlias: String

Attributes

Source
PathAliasing.scala
val workspaceAlias: String

Attributes

Source
PathAliasing.scala