Nebula
Loading...
Searching...
No Matches
IO::ProjectLocator Class Reference

#include <projectlocator.h>

Detailed Description

Resolves the project root and the toolkit (nebula root) directory.

The project info file always lives in the project root. Project identity is therefore a property of where you are.

Resolution order, highest priority first:

  1. an environment variable (NEBULA_PROJECT / NEBULA_TOOLKIT)
  2. walking up from the current working directory looking for the project info file
  3. the value embedded by the build system (NEBULA_PROJECT_ROOT / NEBULA_TOOLKIT_ROOT), which is only needed when the tool is invoked from a build directory that is not inside the project

An explicit command line override outranks all of these, but is handled by the caller, since the locator must not depend on the application layer.

Static Public Member Functions

static Util::String GetProjectRoot ()
 resolve the project root, empty string if it cannot be found
static Util::String GetToolkitRoot ()
 resolve the toolkit (nebula root) directory, empty if not found
static Util::String FindProjectRoot (const Util::String &startDir)
 walk up from startDir looking for the project info file

Static Public Attributes

static const char * ProjectInfoFileName = "projectinfo.json"
 name of the project info file, which is always in the project root

Member Function Documentation

◆ FindProjectRoot()

String IO::ProjectLocator::FindProjectRoot ( const Util::String & startDir)
static

walk up from startDir looking for the project info file

◆ GetProjectRoot()

String IO::ProjectLocator::GetProjectRoot ( )
static

resolve the project root, empty string if it cannot be found

◆ GetToolkitRoot()

String IO::ProjectLocator::GetToolkitRoot ( )
static

resolve the toolkit (nebula root) directory, empty if not found

Member Data Documentation

◆ ProjectInfoFileName

const char * IO::ProjectLocator::ProjectInfoFileName = "projectinfo.json"
static

name of the project info file, which is always in the project root


The documentation for this class was generated from the following files: