Interface IPlatformEnvironment
Resolves platform paths from an explicit platform root rather than the process working directory.
public interface IPlatformEnvironment
Remarks
The platform root is the directory that holds rdcore.json and one subfolder per component
(RDCore.CLI/, RDCore.LanguageServer/, …). A component's own base directory is
<Root>/<Component>/, so the root is that directory's parent: independent of the
working directory a process happens to be started with.
Properties
LogsDirectory
Absolute path of the folder the platform's components write their logs to, created if missing: the user's, not the platform root's, so that a
platform can be installed where its user can't write (Program Files, /opt).
string LogsDirectory { get; }
Property Value
Remarks
- Windows:
%LOCALAPPDATA%\RDCore\Logs. Local, not roaming: a log is of the machine it was written on. - macOS:
~/Library/Logs/RDCore. - Linux and others:
$XDG_STATE_HOME/rdcore/logs, or~/.local/state/rdcore/logswhereXDG_STATE_HOMEisn't set: the XDG Base Directory Specification places logs in the user's state.
RDCORE_LOGS_DIRECTORY (LogsEnvironmentVariable) overrides it everywhere.
ManifestPath
Absolute path of the platform manifest, <Root>/rdcore.json.
string ManifestPath { get; }
Property Value
Root
The platform root directory.
string Root { get; }
Property Value
UserDataDirectory
Absolute path of the folder of the platform's user: %USERAPPDATA%/RDCore, where what the user sets for themselves is kept - their settings
(UserSettingsStore). Not created: nothing is kept there until something is.
string UserDataDirectory { get; }
Property Value
Remarks
It is not under Root: a platform that is deployed again replaces what is there, and what the user set is theirs to keep.
Methods
Resolve(string)
Resolves a root-relative path (either slash style) to an absolute path under Root.
string Resolve(string rootRelativePath)