Workspace.State (Workspace v0.3.1)
View SourceThe low-level API and the workspace state struct.
The %Workspace.State{} structure
Every workspace is stored internally as a struct containing the following fields:
:projects- a map of the form%{atom => Workspace.Project.t()}where the key is the defined project name. It includes all detected workspace projects excluding any ignored ones.:cwd- the directory from which the generation of the workspace struct occurred.:mix_path- absolute path to the workspace's rootmix.exsfile.:workspace_path- absolute path of the workspace, this is by default the folder containing the workspace mix file.:git_root_path- the absolute path of the git repository containing the workspace:config- the workspace's configuration, checkWorkspace.Configfor more details.
Summary
Functions
Initializes a new workspace from the given settings.
Types
@type t() :: %Workspace.State{ config: keyword(), cwd: binary(), git_root_path: binary() | nil, graph: :digraph.graph(), mix_path: binary(), projects: %{required(atom()) => Workspace.Project.t()}, status_updated?: boolean(), workspace_path: binary() }
Struct holding the workspace state.
It contains the following:
:projects- A map with all workspace projects.:config- The workspace configuration settings.:mix_path- The path to the workspace's rootmix.exs.:workspace_path- The workspace root path.:git_root_path- The git root path, of the repository containing the workspace.:cwd- The directory from which the workspace was generated.:graph- The DAG (directed acyclic graph) of the workspace.:status_updated?- Set totrueif the workspace status has been updated.
Functions
@spec new( path :: String.t(), mix_path :: String.t(), config :: keyword(), projects :: [Workspace.Project.t()] ) :: t()
Initializes a new workspace from the given settings.
It expects the following:
pathis the root path of the workspacemix_pathis the root mix file, usually amix.exsin thepathconfigis the workspace configurationprojectsis a list of workspace projects
Notice that no validation is applied at this level.