Package atessera.comp
Class LocalCompiler
java.lang.Object
atessera.comp.LocalCompiler
- All Implemented Interfaces:
Compiler
Default
Compiler implementation that executes commands locally
in an isolated temporary directory.
LocalCompiler performs the following steps for each
CompilationTask:
- Creates a temporary working directory via
TempDir. - Writes all text and binary source files into that directory.
- Executes the task's shell commands sequentially. Each command's
stdout and stderr are captured in separate threads (via
ShellCmd) to prevent deadlocks. - If a command fails (non-zero exit code), collects the files
listed in
saveTextFilesOnFailureand returns immediately. - If all commands succeed, collects the files listed in
saveTextFilesOnSuccessandsaveBinaryFilesOnSuccess. - Cleans up the temporary directory (via try-with-resources).
In case of an internal exception (e.g. I/O error), the method sets
the exit code to -1, captures the stack trace in the result,
and returns the result object; it does not throw.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompile(CompilationTask task) Executes the compilation task in a local temporary directory.
-
Constructor Details
-
LocalCompiler
public LocalCompiler()
-
-
Method Details
-
compile
Executes the compilation task in a local temporary directory.
-