danielburrell / kbld4j

Java wrapper for kbld binary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kbld4j

kbld4j is a java wrapper around the popular kbld binary integrating with zeroturnaround's excellent process executor.

Usage

ProcessExecutor pe = Kbld.kbld()
        .pkg()
        .file(lockFile)
        .output(archiveFile)
        .executeAs();

You can then execute this command via the zero-turnaround API as follows:

try {
    pe.directory(lockfileDirectory)
        .redirectErrorStream(true)
        .readOutput(true)
        .exitValue(0).execute();
} catch (InvalidExitValueException e) {
    logger.error("kbld exited with code {}", e.getExitValue());
    logger.error("Check the following kbld logs for what went wrong: {}", e.getResult().outputUTF8());
    throw new KbldException(e);
}

About

Java wrapper for kbld binary

License:MIT License


Languages

Language:Java 100.0%