Skip to content

Tool environment

NXBuild.Environment.nxscript is editable configuration beside Nexus Build and Nexus Forge in the installation's bin directory. It contains the Tools environment and reusable project defaults.

Setup fills installation-specific locations and preserves user changes during updates and repair.

Use the configuration explicitly

module Tools "NXBuild.Environment.nxscript";

// Inside a Project:
NXPC Application (Tools.Defaults.Pascal) {
    SourceFiles: ["main.pas"];
    OutputPath: "build";
}

The project selects those defaults through ordinary Nexus Script inheritance. The presence of an NXPC or LLVM operation does not implicitly apply every setting from the environment.

A local module at the declared path takes precedence. If that particular filename is absent locally, the Nexus Build-owned loader resolves it beside the running tool. Other module names keep ordinary module resolution.

Nexus Forge's first-class NXBuild task uses the same loader and engine as standalone Nexus Build. It does not need to forward compiler, LLVM, or SDK paths.

Supplied profiles

Definition Intended use
Tools.Defaults.Pascal Nexus Pascal compilation with matching native RTL/tool paths
Tools.Defaults.C Clang C
Tools.Defaults.CPP Clang C++, including C++ driver linkage
Tools.Defaults.Native MSVC compilation
Tools.Defaults.Solution MSBuild
Tools.Defaults.Project CMake

The supplied native profiles cover Windows x64 and Linux x64. Cross-linking requires explicit target settings and matching SDKs/sysroots.

The environment also declares Java and Android SDK locations. A project can use them in an operation's environment:

Environment: [
    "ANDROID_HOME=" + @Tools.Android.Path,
    "JAVA_HOME=" + @Tools.Java.Home
];

These declarations do not write global environment variables.

Locations and ownership

$NXBuildBin is the running tool's binary directory; $NXBuildRoot is its parent installation directory. Installed dialects are under <installation>/scripts.

Nexus source builds additionally import Nexus.Environment.nxscript. That module declares development checkout/worktree paths. End-user applications do not need it.

When replacing a compiler or package SDK manually, keep their identities and artifacts matched. Tools.NXPC.PackageSDKIdentity must agree with the selected SDK's sdk.json.

Maintenance

Setup records which literal values it wrote. Later maintenance updates unchanged managed values while retaining user edits, expressions, imported definitions, and comments. Uninstall preserves this configuration file.

Do not copy another machine's absolute SDK paths unchanged. Select the local tools you intend to use, then validate and build a real project.