![JAR search and dependency download from the Maven repository](/logo.png)
dev.gradleplugins.runnerkit.providers.StacktraceProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-runner-kit-impl Show documentation
Show all versions of gradle-runner-kit-impl Show documentation
Gradle runner kit implementation.
package dev.gradleplugins.runnerkit.providers;
import dev.gradleplugins.runnerkit.GradleExecutionContext;
import dev.gradleplugins.runnerkit.InvalidRunnerConfigurationException;
import java.util.List;
import static java.util.Collections.emptyList;
import static java.util.Collections.singletonList;
public final class StacktraceProvider extends AbstractGradleExecutionProvider implements GradleExecutionCommandLineProvider {
public static StacktraceProvider hide() {
return fixed(StacktraceProvider.class, GradleExecutionContext.Stacktrace.HIDE);
}
public static StacktraceProvider show() {
return fixed(StacktraceProvider.class, GradleExecutionContext.Stacktrace.SHOW);
}
@Override
public List getAsArguments() {
if (get().equals(GradleExecutionContext.Stacktrace.SHOW)) {
return singletonList("--stacktrace");
}
return emptyList();
}
@Override
public void validate(GradleExecutionContext context) {
if (context.getArguments().get().stream().anyMatch(it -> it.equals("--stacktrace") || it.equals("-s"))) {
throw new InvalidRunnerConfigurationException("Please remove stacktrace command line flags as showing the stacktrace is the default behavior of all toolbox runner.");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy