View Source Lexical.Project (lexical_shared v0.5.0)

The representation of the current state of an elixir project.

This struct contains all the information required to build a project and interrogate its configuration, as well as business logic for how to change its attributes.

Link to this section Summary

Functions

Retrieves the name of the project as an atom

Returns the full path to the directory where lexical puts build artifacts

Returns the the name definied in the project/0 of mix.exs file

Creates and initializes lexical's workspace directory if it doesn't already exist

Returns the full path to the project's mix.exs file

Retrieves the name of the project

The project node's name

Returns the full path of the project's root directory

Returns the full path to the project's lexical workspace directory

Returns the full path to a file in lexical's workspace directory

Link to this section Types

@type error_with_message() :: {:error, message()}
@type message() :: String.t()
Link to this type

restart_notification()

View Source
@type restart_notification() :: {:restart, Logger.level(), String.t()}
@type t() :: %Lexical.Project{
  entropy: non_neg_integer(),
  env_variables: term(),
  mix_env: term(),
  mix_exs_uri: Lexical.uri() | nil,
  mix_project?: term(),
  mix_target: term(),
  project_config: term(),
  project_module: term(),
  root_uri: Lexical.uri() | nil
}

Link to this section Functions

@spec atom_name(t()) :: atom()

Retrieves the name of the project as an atom

Returns the full path to the directory where lexical puts build artifacts

Link to this function

change_environment_variables(project, environment_variables)

View Source
@spec change_environment_variables(t(), map() | nil) ::
  {:ok, t()} | error_with_message() | restart_notification()

Returns the the name definied in the project/0 of mix.exs file

Link to this function

ensure_workspace(project)

View Source

Creates and initializes lexical's workspace directory if it doesn't already exist

@spec mix_exs_path(t()) :: Path.t() | nil

Returns the full path to the project's mix.exs file

@spec name(t()) :: String.t()

Retrieves the name of the project

@spec new(Lexical.uri()) :: t()

The project node's name

@spec project_path(t()) :: Path.t() | nil
@spec root_path(t()) :: Path.t() | nil

Returns the full path of the project's root directory

Link to this function

set_env_vars(old_project, env_vars)

View Source
Link to this function

set_project_module(project, module)

View Source
@spec set_project_module(t(), module() | nil) :: t()
@spec workspace_path(t()) :: String.t()

Returns the full path to the project's lexical workspace directory

Lexical maintains a workspace directory in project it konws about, and places various artifacts there. This function returns the full path to that directory

Link to this function

workspace_path(project, relative_path)

View Source
@spec workspace_path(t(), String.t() | [String.t()]) :: String.t()

Returns the full path to a file in lexical's workspace directory