use of org.gradle.internal.logging.ConsoleRenderer in project gradle by gradle.
the class RunTestExecutable method handleTestFailures.
private void handleTestFailures(Exception e) {
String message = "There were failing tests";
String resultsUrl = new ConsoleRenderer().asClickableFileUrl(getOutputDir());
message = message.concat(". See the results at: " + resultsUrl);
if (isIgnoreFailures()) {
getLogger().warn(message);
} else {
throw new GradleException(message, e);
}
}
use of org.gradle.internal.logging.ConsoleRenderer in project gradle by gradle.
the class Test method handleTestFailures.
private void handleTestFailures() {
String message = "There were failing tests";
DirectoryReport htmlReport = reports.getHtml();
if (htmlReport.isEnabled()) {
String reportUrl = new ConsoleRenderer().asClickableFileUrl(htmlReport.getEntryPoint());
message = message.concat(". See the report at: " + reportUrl);
} else {
DirectoryReport junitXmlReport = reports.getJunitXml();
if (junitXmlReport.isEnabled()) {
String resultsUrl = new ConsoleRenderer().asClickableFileUrl(junitXmlReport.getEntryPoint());
message = message.concat(". See the results at: " + resultsUrl);
}
}
if (getIgnoreFailures()) {
getLogger().warn(message);
} else {
throw new GradleException(message);
}
}
use of org.gradle.internal.logging.ConsoleRenderer in project gradle by gradle.
the class HtmlDependencyReportTask method generate.
@TaskAction
public void generate() {
if (!reports.getHtml().isEnabled()) {
setDidWork(false);
return;
}
HtmlDependencyReporter reporter = new HtmlDependencyReporter(getVersionSelectorScheme(), getVersionComparator());
reporter.render(getProjects(), reports.getHtml().getDestination());
getProject().getLogger().lifecycle("See the report at: {}", new ConsoleRenderer().asClickableFileUrl(reports.getHtml().getEntryPoint()));
}
use of org.gradle.internal.logging.ConsoleRenderer in project gradle by gradle.
the class CompareGradleBuilds method communicateResult.
private void communicateResult(BuildComparisonResult result) {
File reportFile = new File(getReportDir(), GradleBuildComparison.HTML_REPORT_FILE_NAME);
String reportUrl = new ConsoleRenderer().asClickableFileUrl(reportFile);
if (result.isBuildsAreIdentical()) {
getLogger().info("The build outcomes were found to be identical. See the report at: {}", reportUrl);
} else {
String message = String.format("The build outcomes were not found to be identical. See the report at: %s", reportUrl);
if (getIgnoreFailures()) {
getLogger().warn(message);
} else {
throw new GradleException(message);
}
}
}
use of org.gradle.internal.logging.ConsoleRenderer in project gradle by gradle.
the class FindBugs method evaluateResult.
@VisibleForTesting
void evaluateResult(FindBugsResult result) {
if (result.getException() != null) {
throw new GradleException("FindBugs encountered an error. Run with --debug to get more information.", result.getException());
}
if (result.getErrorCount() > 0) {
throw new GradleException("FindBugs encountered an error. Run with --debug to get more information.");
}
if (result.getBugCount() > 0) {
String message = "FindBugs rule violations were found.";
SingleFileReport report = reports.getFirstEnabled();
if (report != null) {
String reportUrl = new ConsoleRenderer().asClickableFileUrl(report.getDestination());
message += " See the report at: " + reportUrl;
}
if (getIgnoreFailures()) {
getLogger().warn(message);
} else {
throw new GradleException(message);
}
}
}
Aggregations