Search in sources :

Example 1 with ExecutableRunner

use of com.synopsys.integration.executable.ExecutableRunner in project synopsys-detect by blackducksoftware.

the class DetectExecutableRunner method execute.

@NotNull
public ExecutableOutput execute(Executable executable, boolean outputContainsSecret) throws ExecutableRunnerException {
    ExecutableRunner targetRunner = runner;
    if (outputContainsSecret) {
        targetRunner = secretRunner;
    }
    ExecutableOutput output = targetRunner.execute(executable);
    eventSystem.publishEvent(Event.Executable, new ExecutedExecutable(output, executable));
    boolean normallyLogOutput = output.getReturnCode() != 0 && shouldLogOutput && !logger.isDebugEnabled() && !logger.isTraceEnabled();
    if (normallyLogOutput && !outputContainsSecret) {
        if (StringUtils.isNotBlank(output.getStandardOutput())) {
            logger.info("Standard Output: ");
            logger.info(output.getStandardOutput());
        }
        if (StringUtils.isNotBlank(output.getErrorOutput())) {
            logger.info("Error Output: ");
            logger.info(output.getErrorOutput());
        }
    }
    return output;
}
Also used : ExecutableOutput(com.synopsys.integration.executable.ExecutableOutput) ExecutableRunner(com.synopsys.integration.executable.ExecutableRunner) DetectableExecutableRunner(com.synopsys.integration.detectable.detectable.executable.DetectableExecutableRunner) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

DetectableExecutableRunner (com.synopsys.integration.detectable.detectable.executable.DetectableExecutableRunner)1 ExecutableOutput (com.synopsys.integration.executable.ExecutableOutput)1 ExecutableRunner (com.synopsys.integration.executable.ExecutableRunner)1 NotNull (org.jetbrains.annotations.NotNull)1