[856:7] extends: object
BuildLog reports build progress to the terminal. When standard output
is an interactive terminal it shows a colored, in-place status line for
the running task and a colored result line as each task finishes. When
output is piped to a file or another process it falls back to plain
one-line-per-task logging, so logs stay readable in files and CI with no
escape bytes mixed in. The mode is chosen automatically from the
terminal but can be forced to "tui" or "plain".
The terminal styling is written with raw ANSI escape sequences. The
escape byte is the \u001b Unicode escape, held in escValue.
BuildLog (string Mode = "auto")
Creates a build log. The mode decides how progress is shown: "auto" uses the terminal UI when stdout is a TTY and plain logging otherwise, "tui" always uses the terminal UI, and "plain" always uses plain logging.
Mode is one of "auto", "tui", or "plain".sgr (string Code, string Text)
Wraps text in an ANSI color code, or returns it unchanged in plain mode so piped logs carry no escape bytes.
Code is the SGR parameter string, such as "32" for green.Text is the text to color.The colored text in terminal mode, or the plain text otherwise.green (string Text)
Colors text green, used for success.
Text is the text to color.The colored text.red (string Text)
Colors text red, used for failure.
Text is the text to color.The colored text.dim (string Text)
Dims text, used for skipped tasks and secondary detail.
Text is the text to color.The colored text.bold (string Text)
Bolds text, used for headings.
Text is the text to color.The colored text.statusWord (string Status)
Returns the colored status word for a finished task: green for done, dim for skipped, and red for failed.
Status is a taskStatus member.A short colored status string.clearLine ()
Clears the current terminal line and returns the cursor to its start, so the next write overwrites what was there. Does nothing in plain mode.
null.begin (int Total)
Starts a build of the given number of tasks. Resets the counters so one log can be reused across runs.
Total is the number of tasks that will run.this log for chaining.taskStart (string Name)
Reports that a task is starting. In terminal mode it draws an in-place status line for the running task, overwritten when the task finishes; in plain mode it prints nothing, since the result line is enough.
Name is the task name.null.taskDone (string Name, string Status)
Reports that a task finished with a status. In terminal mode it overwrites the running status line with a colored result line; in plain mode it prints a plain result line.
Name is the task name.Status is a taskStatus member.null.cleaned (int Count)
Reports that clean removed a number of outputs. Clean runs before the task pipeline and is not one of the counted tasks, so it gets its own line.
Count is the number of output paths removed.null.summary (bool Ok, int Skipped)
Prints the final build summary. On success it names the task and skip counts; on failure it prints a red failure line. Any in-place status line is cleared first.
Ok is true when the build succeeded.Skipped is the number of tasks that were up to date.null.[53:7] extends: object
BuildTask is the base class for every build step. A subclass overrides
run() to do its work and, to take part in incremental builds,
overrides inputs() and outputs() to declare the files it reads and
writes. The runner calls execute(), never run() directly, so the
up-to-date check always runs first.
Aussom has no super call, so the base cannot be a method the subclass
wraps. Instead execute() is a template method the runner calls, and it
calls this.run() - the override point the subclass fills in. Aussom
dispatches this.run() to the subclass's version.
BuildTask (string Name = "task")
Creates a build task with a display name.
Name is the task's name, used in results and logs.run ()
Does the task's work. This is the override point; the base version is a placeholder that reports the task was not implemented. A subclass returns a result map with a
successkey, matching the JavaTools operations.
A result map with at least success.inputs ()
Returns the files this task reads. The default is an empty list, which turns the incremental check off for the task (it always runs). A subclass overrides this to declare its inputs.
A list of input file paths.outputs ()
Returns the files this task writes. The default is an empty list. A subclass overrides this to declare its outputs.
A list of output file paths.execute ()
Runs the task unless it is already up to date. The runner calls this. It sets
statusValueto skipped, done, or failed and returns a result map carrying the task name and status alongside whateverrun()returned. When content-hash mode is on, it writes the stamp after a successful run.
A result map with name, status, and success.isUpToDate ()
Returns true when the task can be skipped. When either the input or output list is empty the task cannot be judged and always runs; when any output is missing it runs; otherwise the timestamp or content check decides.
true when the task is up to date.timestampUpToDate (list Ins, list Outs)
The timestamp up-to-date check: true when the oldest output is at least as new as the newest input, so nothing changed since the last build.
Ins is the input path list.Outs is the output path list.true when up to date.newestUnder (string Path)
Returns the newest modification time under a path: a directory is measured by its newest contained file, so replacing one source and rebuilding marks the tree fresh; a plain file is its own mtime.
Path is the file or directory path.An int with the newest epoch-millis mtime, or 0 when absent.collectFiles (list Paths)
Flattens a list of paths to the files they hold, walking any directories. Used by the content-hash check.
Paths is a list of file or directory paths.A list of file paths.inputsHash (list Ins)
Computes a stable stamp string from the SHA-256 of every input file's contents, in sorted order so the result does not depend on walk order.
Ins is the input path list.A string with one "path:hash" line per input file.stampPath (list Outs)
Returns the stamp file path for a set of outputs: inside the first output when it is a directory, or beside it when it is a file.
Outs is the output path list.A string with the stamp file path.hashUpToDate (list Ins, list Outs)
The content-hash up-to-date check: true when the stored stamp matches a freshly computed hash of the inputs.
Ins is the input path list.Outs is the output path list.true when up to date.writeStamp ()
Writes the input hash to the stamp file after a successful run, so the next content-hash check can compare against it.
null.[1053:7] extends: CliParser
BuildRunner reads command-line options and runs build tasks. It is a
CliParser, so it parses arguments and prints help, and it holds tasks it
runs for the selected actions. Construct it with command-line arguments
plus a source path for the easy path, or with no arguments to add tasks
by hand.
Flag order never matters: the flags select a set of steps run in one
canonical order, and clean always runs first.
BuildRunner (Args = null, SourcesPath = null, BuildExecutableJar = false, Deps)
Creates a build runner. With a source path, the standard tasks are built for you (the easy path); with none, the runner starts empty for programmatic use. When arguments are given they are parsed to select the actions.
Args is the command-line argument list, or null.SourcesPath is the Java source directory, or null for the programmatic path.BuildExecutableJar is true to give the jar a Main-Class header and bundle the resolved dependencies.Deps is a list of Maven coordinates to resolve; defaults to none.registerDefaultFlags ()
Registers the default action flags on the option set.
this runner for chaining.add (Task)
Adds a task to the end of the pipeline (the programmatic path).
Task is a BuildTask (or subclass).this runner for chaining.setDeps (list Deps)
Sets the Maven coordinates to resolve. These feed the ResolveTask and the compile classpath.
Deps is a list of "group:artifact:version" strings.this runner for chaining.setModular (bool Modular)
Forces modular mode on or off, overriding the auto-detection. Modular mode wires the resolved dependencies onto the compile module path (rather than the class path) so javac can resolve a module's
requires. When this is not called, the runner auto-detects modular mode from amodule-info.javaunder the source path.
Modular is true to compile as a module, false to force plain.this runner for chaining.setCoordinates (string Group, string Artifact, string Version)
Sets the Maven coordinates for install: the groupId, artifactId, and version the jar is installed under. Install needs these; without them the install step fails with a clear message.
Group is the Maven groupId.Artifact is the Maven artifactId.Version is the Maven version.this runner for chaining.detectModular (string SourcesPath)
Returns true when a
module-info.javais found under the source path, which marks the project as a module.
SourcesPath is the Java source directory.true when the project is modular.setMainClass (string MainClass)
Sets the application main class, used as the jar's entry point and the app image's launcher.
MainClass is the fully qualified main class name.this runner for chaining.setAction (Action)
Sets the single action to run, replacing the default and the CLI selection. The CLI can select several actions; this setter is the common single-action case for the programmatic path.
Action is a buildAction member.this runner for chaining.setLogMode (string Mode)
Sets how build progress is shown, overriding auto-detection. Use this for the programmatic path; the CLI sets it from --tui/--plain.
Mode is one of "auto", "tui", or "plain".this runner for chaining.applyCli (list Args)
Parses the command line and selects the actions from the flags that are set. When help is requested it records that for run() to handle.
Args is the command-line argument list.this runner for chaining.projectName ()
Returns the project name used for the jar and app image, derived from the current directory, or "app" when it cannot be determined.
A string with the project name.buildStandardTasks (string SourcesPath, bool BuildExecutableJar)
Builds the standard tasks for a conventional project and stores them by pipeline phase. Called by the easy-path constructor.
SourcesPath is the Java source directory.BuildExecutableJar is true to make the jar executable and bundle the resolved dependencies.this runner for chaining.canonicalOrder ()
Returns the standard pipeline phases in canonical run order.
A list of phase name strings.actionPhases (Action)
Returns the pipeline phases a single build action runs.
Action is a buildAction member.A list of phase name strings.buildActions ()
Returns the selected actions with clean removed.
A list of buildAction members.selectedPhases ()
Returns the union of pipeline phases for the selected build actions.
A list of phase name strings.tasksForActions ()
Returns the tasks to run for the selected actions: the standard tasks for the selected phases in canonical order, then any tasks added by hand.
A list of BuildTask objects.allTasks ()
Returns every task the runner knows about, standard and added, regardless of the selected actions. Used by clean.
A list of BuildTask objects.runClean ()
Removes every task's declared outputs.
A list of the output paths removed.run ()
Runs the selected actions. When help was requested it prints help and returns. Clean runs first when selected; when clean is the only action the run stops there. The build actions then run their tasks in canonical pipeline order, stopping at the first failing task when stopOnFailure is true.
A result map with success and a per-task results list.reportFailure (Result)
Prints a concise reason for a failed task to stderr, so a build failure is visible rather than buried in the returned result map.
Result is the failing task's result map.null.failureReason (Result)
Extracts a useful failure reason from a task result: the tool's failure message, then structured compile errors, then the raw streams, falling back to a generic note.
Result is the failing task's result map.A string with the failure reason.[716:7] extends: BuildTask
InstallTask installs the built jar and its companion artifacts into the
local Maven repository. It renders a POM from the project coordinates and
dependency list with the handlebars module, packages a sources jar from the
source tree and a javadoc jar from the generated docs, and installs the set
through JavaTools.install.
It is not incremental: it installs every time it runs, so re-installing the
same version needs no version bump and no manual delete from the local
repository. It needs coordinates - setCoordinates on the runner - and
fails with a clear message when they are missing.
InstallTask (Jt, JarPath, SourcesDir, DocsDir, DistDir)
Creates the install task.
Jt is the JavaTools used to jar and install.JarPath is the built main jar to install.SourcesDir is the source tree to package as the sources jar.DocsDir is the generated Javadoc directory to package as the javadoc jar.DistDir is the directory to write the POM and companion jars to.depObjects ()
Splits the "group:artifact:version" dependency strings into objects the POM template can iterate.
A list of {groupId, artifactId, version} maps.renderPom ()
Renders the POM XML from the coordinates and dependency list using the handlebars module, so there is no hand-built XML string.
A string with the POM XML.run ()
Renders and writes the POM, packages the sources and javadoc jars, and installs the set into the local Maven repository.
The JavaTools.install result map, or a failure map when the coordinates or jar are missing.inputs ()
Declares the built jar as the input. Kept for symmetry; the task is not incremental, so this does not gate the run.
A list with the jar path.[420:7] extends: BuildTask
JavadocTask generates documentation through JavaTools.javadoc. Its
inputs are the source files and its output is the docs directory.
JavadocTask (Spec, Jt = null)
Creates a javadoc task from a JavaDoc spec.
Spec is a JavaDoc options object.Jt is the JavaTools to run it; a new one is made when null.run ()
Generates the documentation.
The JavaTools.javadoc result map.inputs ()
Returns every .java file under the spec's source roots.
A list of source file paths.outputs ()
Returns the docs directory as the task's output.
A list holding the docs directory.[580:7] extends: BuildTask
JlinkTask builds a custom runtime image through JavaTools.jlink. Its
inputs are the module-path jars it consumes and its output is the image
directory. jlink requires the output directory not to exist, so the
task removes a stale one before running.
JlinkTask (Spec, Jt = null)
Creates a jlink task from a JavaLink spec.
Spec is a JavaLink options object.Jt is the JavaTools to run it; a new one is made when null.run ()
Removes a stale image and builds the runtime image.
The JavaTools.jlink result map.inputs ()
Returns the module-path jars as the task's inputs.
A list of module-path paths.outputs ()
Returns the image directory as the task's output.
A list holding the image directory.[19:6] static extends: object
Enum defines a build task's lifecycle status. pending before it runs,
skipped when the incremental check found it up to date, done on a
successful run, and failed otherwise.
[490:7] extends: BuildTask
ResolveTask resolves Maven dependencies through JavaTools.resolve. It
has no local inputs to track, so it runs every time; resolution is
cache-backed by the local Maven repository, so re-running is cheap.
In the easy path it also wires the resolved classpath into the compile
spec (and, for an executable jar, the jar's bundle), so a later compile
sees the dependency classpath.
ResolveTask (Deps, Jt = null)
Creates a resolve task.
Deps is a list of "group:artifact:version" strings.Jt is the JavaTools to run it; a new one is made when null.wireInto (CompileSpec, JarSpec, DocSpec = null)
Wires the resolved dependencies into a compile spec, a doc spec, and, optionally, a jar spec's bundle. Called by the runner in the easy path. The compile and doc specs get the module path in modular mode and the class path otherwise.
CompileSpec is a JavaCompile to wire, or null.JarSpec is a JavaJar whose bundle to set, or null.DocSpec is a JavaDoc to wire, or null.this task for chaining.wirePath (Spec, Cp)
Sets the resolved classpath on a spec's compile inputs: the module path in modular mode (so javac and javadoc resolve the module's
requires) and the class path otherwise.
Spec is a JavaCompile or JavaDoc.Cp is the resolved classpath list.null.run ()
Resolves the dependencies and wires them into the specs.
The JavaTools.resolve result map, or a trivial success when there are no dependencies.[289:7] extends: BuildTask
JavaCompileTask compiles Java source through JavaTools.compile. Its
inputs are the .java files under the spec's sources and its output is
the class directory, so it skips when no source is newer than the
compiled classes.
JavaCompileTask (Spec, Jt = null)
Creates a compile task from a JavaCompile spec.
Spec is a JavaCompile options object.Jt is the JavaTools to run it; a new one is made when null.run ()
Compiles the spec's sources.
The JavaTools.compile result map.inputs ()
Returns every .java file under the spec's source roots.
A list of source file paths.outputs ()
Returns the compiled class tree as the task's output.
A list holding the output directory.javaFilesUnder (list Sources)
Collects the .java files under a list of source roots, walking directories and skipping paths that do not exist.
Sources is a list of file or directory paths.A list of .java file paths.[365:7] extends: BuildTask
JavaJarTask packages class files through JavaTools.jar. Its inputs are
the class trees it packages plus any bundled jars, and its output is the
jar path.
JavaJarTask (Spec, Jt = null)
Creates a jar task from a JavaJar spec.
Spec is a JavaJar options object.Jt is the JavaTools to run it; a new one is made when null.run ()
Packages the jar.
The JavaTools.jar result map.inputs ()
Returns the class trees and bundled jars the jar packages.
A list of input paths.outputs ()
Returns the jar path as the task's output.
A list holding the jar path.[638:7] extends: BuildTask
JpackageTask builds a native app image or installer through
JavaTools.jpackage. Its inputs are the application jars (and any custom
runtime image) it consumes; its output is the destination directory. It
removes a stale app image before running, since jpackage refuses to
overwrite one.
JpackageTask (Spec, Jt = null)
Creates a jpackage task from a JavaPackage spec.
Spec is a JavaPackage options object.Jt is the JavaTools to run it; a new one is made when null.destDir ()
Returns the destination directory, defaulting to build/jpackage.
A string with the destination directory.run ()
Removes a stale app image and builds the package.
The JavaTools.jpackage result map.inputs ()
Returns the application jars and any custom runtime image as inputs.
A list of input paths.outputs ()
Returns the destination directory as the task's output.
A list holding the destination directory.[31:6] static extends: object
Enum defines the build actions a BuildRunner can run. clean removes
outputs; the rest name a slice of the standard pipeline. Each member is
its own name as a string, as in the javatools enums.