Nexus Forge
Nexus Forge executes declarative automation written in Nexus Script: project builds, filesystem operations, downloads, archive extraction, Git checkouts, rendering, and release assembly.
Use Nexus Build to build a project. Use Nexus Forge to compose that build with other work.
Build a project
Beside the Hello project, save Hello.Forge.nxscript:
dialect "projects/forge/language/Forge.nxscript";
Project HelloBuild {
Id: "Example.HelloBuild";
NXBuild Application {
EntryPoint: "Hello.nxproject";
}
}
Run it on Windows:
nxforge /input=Hello.Forge.nxscript /targets=TargetOS:win64,TargetCPU:x86_64,BuildConfiguration:Debug
Use TargetOS:linux on Ubuntu.
Nexus Build is a first-class task executed through the Nexus Build engine inside Nexus Forge. It is not a Mustache command invoking another nxbuild executable. TargetOS, TargetCPU, and BuildConfiguration come from the Nexus Forge invocation unless explicitly overridden on the task.
Compose work
Group, Project, and Package execute children in declaration order and
stop on failure. Use ordinary Nexus Script composition to reuse recipes.
Project and Group containers can carry ordinary recipe data properties.
Platform variants can retain the same task name with different target clauses. A task's name describes its work; target filters select its implementation. See Nexus Script relationships.
A project's Requires metadata in Nexus Forge does not implicitly build a dependency
graph. Nexus Build owns that behavior for .nxproject descriptions.
Native operations
| Task | Use |
|---|---|
NXBuild |
Validate, plan, or build a Nexus Build project |
CopyFile / CopyFiles |
Copy a file/tree or a selection of files/masks |
CreateDirectory / DeletePath |
Explicit filesystem work |
Download |
HTTP/HTTPS transfer |
Archive |
ZIP creation/extraction and 7z extraction |
Git |
Status or a verified checkout of a full pinned commit |
Render |
Compile a model and render a Mustache artifact |
The current Git task supports Status and Checkout. Checkout verifies and
reuses the declared revision; it is not an implicit update to a branch tip.
For tools supplied by the development environment, command tasks can use typed
definitions and Mustache templates. Run is the explicit general command
operation. It is not necessary for Nexus Build, copying, or downloading.
Download and extract
dialect "projects/forge/language/Forge.nxscript";
Group Dependencies {
Download Fetch {
URL: "https://example.org/dependency.7z";
Destination: "downloads/dependency.7z";
}
Archive Unpack {
Operation: Extract;
Source: "downloads/dependency.7z";
Destination: "dependencies";
}
}
Replace the example URL with the actual dependency. Paths resolve from the
Nexus Forge document. Both tasks default to Overwrite: False.
HTTPS verifies certificates and hostnames. The optional CAFile selects a
PEM trust bundle. Failed downloads preserve the previous destination.
Extract recognizes 7z and ZIP; Unzip is ZIP-specific and Zip creates
ZIP archives. 7z decoding is linked into Nexus Forge; a 7-Zip installation is not
required. Creation of 7z files and encrypted 7z archives are not supported.
Invocation and failures
The CLI supplies native host/target selections and Debug when omitted. Use explicit product targets in reproducible build commands.
A failed task stops later tasks. Completed work remains; the recipe is not a transaction. Declare required verification steps in the recipe itself.
Paths use forward slashes, including Windows paths. Tool names and executable
suffixes remain explicit; Nexus Forge does not append .exe.
See the execution reference and documentation publishing recipe.