Main interfaces for code of battery.
Code Map
//! Main interfaces for code of battery.
module battery.commonInterfaces;
public import battery.defines;
//! A single project can either be a Lib or Exe.
class Project
{
public:
name: string;
batteryToml: string;
libs: string[];
libPaths: string[];
frameworks: string[];
frameworkPaths: string[];
deps: string[];
defs: string[];
stringPaths: string[];
xld: string[];
xcc: string[];
xlink: string[];
xlinker: string[];
srcDir: string;
srcC: string[];
srcS: string[];
srcObj: string[];
srcAsm: string[];
testFiles: string[];
//! Was this target given a -jo argument.
jsonOutput: string;
//! Should we ignore this project unless explicitly asked for
isExternal: bool;
//! For D projects.
scanForD: bool;
//! Hack to add LLVMVersionX versions.
llvmHack: bool;
warningsEnabled: bool;
public:
this() { }
}
//! The project is built as a library used by executables.
class Lib : Project
{
public:
isTheRT: bool;
public:
this() { }
}
//! The project is built as a executable.
class Exe : Project
{
public:
bin: string;
srcVolt: string[];
public:
this() { }
}
//! Interface to the main class that controles the entire process.
class Driver
{
public:
//! Helper alias
alias Fmt = watt.text.sink.SinkArg;
public:
arch: Arch;
platform: Platform;
public:
this() { }
//! Normalise a path, target must exsist.
fn normalisePath(path: string) string;
//! As the function name imples.
fn removeWorkingDirectoryPrefix(path: string) string;
//! Add a executable
fn add(exe: Exe);
//! Add a library
fn add(lib: Lib);
//! Add a enviromental variable.
fn addEnv(boot: bool, name: string, value: string);
//! Set a tool that has been found.
fn setCmd(boot: bool, name: string, c: Command);
//! Get a tool.
fn getCmd(boot: bool, name: string) Command;
//! Add a tool, will reset the tool if already given.
fn addCmd(boot: bool, name: string, cmd: string);
//! Add a argument for tool.
fn addCmdArg(boot: bool, name: string, arg: string);
//! Prints a action string.
fn action(fmt: scope (Fmt));
//! Prints a info string.
fn info(fmt: scope (Fmt));
//! Error encoutered, print error then abort operation.
fn abort(fmt: scope (Fmt));
}
A single project can either be a Lib or Exe.
Was this target given a -jo argument.
Should we ignore this project unless explicitly asked for
For D projects.
Hack to add LLVMVersionX versions.
The project is built as a library used by executables.
The project is built as a executable.
Interface to the main class that controles the entire process.
Helper alias
Normalise a path, target must exsist.
As the function name imples.
Add a executable
Add a library
Add a enviromental variable.
Set a tool that has been found.
Get a tool.
Add a tool, will reset the tool if already given.
Add a argument for tool.
Prints a action string.
By default it is formated like this:
BATTERY <fmt>
Parameters
fmt |
The format string, same formatting as watt.text.format. |
Prints a info string.
Parameters
fmt |
The format string, same formatting as watt.text.format. |
Error encoutered, print error then abort operation.
May terminate program with exit, or throw an exception to resume.
Parameters
fmt |
The format string, same formatting as watt.text.format. |