use of org.gradle.api.logging.configuration.WarningMode in project gradle by gradle.
the class IntegrationTestSamplesExecutor method run.
@Override
protected int run(String executable, List<String> args, List<String> flags, OutputStream outputStream) {
List<String> filteredFlags = new ArrayList<>();
WarningMode warningMode = WarningMode.Fail;
for (String flag : flags) {
if (flag.startsWith(WARNING_MODE_FLAG_PREFIX)) {
warningMode = WarningMode.valueOf(capitalize(flag.replace(WARNING_MODE_FLAG_PREFIX, "").toLowerCase()));
} else {
filteredFlags.add(flag);
}
}
configureAvailableJdks(filteredFlags);
GradleExecuter executer = gradle.inDirectory(workingDir).ignoreMissingSettingsFile().withStacktraceDisabled().noDeprecationChecks().withWarningMode(warningMode).withToolchainDetectionEnabled().withArguments(filteredFlags).withTasks(args);
try {
if (expectFailure) {
ExecutionFailure result = executer.runWithFailure();
outputStream.write((result.getOutput() + result.getError()).getBytes());
} else {
ExecutionResult result = executer.run();
outputStream.write(result.getOutput().getBytes());
}
return expectFailure ? 1 : 0;
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
Aggregations