craftr.core.context

Context Objects

class Context()

The context carries globally accessible data for a craftr build. If not settings are specified, the craftr.properties file is read from the current working directory (if it exists).

Supported Settings

  • core.build_directory (no default)
  • core.executor (defaults to craftr.core.executor.simple.SimpleExecutor)
  • core.task_selector (defaults to craftr.core.task.selector.default.DefaultTaskSelector)

load_project

 | load_project(path: Path) -> Project

Initialize the root project and return it.

initialize_project

 | initialize_project(project: Project) -> None

Called when a project is created. Can be overwritten by subclasses to customize what happens when a project is created. The default implementationa applies the "default" plugin.

get_default_build_directory

 | get_default_build_directory(project: Project) -> Path

Returns the default build directory for a project, used if no explicit build directory is set. The default implementation returns the .build/ directory in the project's directory, unless core.build_directory is set.