Workspaces¶
Workspaces define the roots or boundaries of projects or a repository.
Workspaces use the special //
prefix marker in paths to refer to tasks consistently in a workspace without having to use relative paths (e.g the double dot marker (..
)) or other mechanisms.
Tasks can not reach out of their Workspace for dependencies (for example, using //..
).
For that matter, the double dot path traversal operator is disabled entirely in Makex Paths.
Usage of Workspaces is not required. If the Workspace is not defined, the root of the filesystem of the current working directory will be used as the Workspace.
Defining a Workspace is highly recommended.
Defining a Workspace¶
Workspaces are defined using the WORKSPACE
environment variable or a WORKSPACE
file.
Using the environment variable to set a workspace is preferred as it is simpler to switch workspaces. If you plan to work on a [mostly] self-contained repository, a WORKSPACE file may be appropriate in the root of the repository. It is recommended to export the WORKSPACE environment variable to all shells so that you can use makex and reference tasks from any folder.
Workspace File¶
Aside from setting the WORKSPACE
environment variable, one may create a WORKSPACE
file at the root of a Workspace.
This will let Makex know the directory with the WORKSPACE
file is the root of the Workspace.
This is simply an empty file (at the moment), though it may be expanded with other functionality.
A WORKSPACE
file should be left in the filesystem to mark boundaries between Workspaces.
The current Workspace¶
The current Workspace is detected as follows, with the first match being the current Workspace:
A file named WORKSPACE file detected inside current working directory or one of its parents.
The
WORKSPACE
environment variable.The root/anchor of the current working directory.