From 5caa41753ad4d4139f1cf878d4aee7b5e24feed6 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Tue, 1 Feb 2011 15:41:17 +0000 Subject: [PATCH] Add check for coverage data before trying to produce report. --- gradle/emma.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gradle/emma.gradle b/gradle/emma.gradle index 0cd8bedf71..eaba985649 100644 --- a/gradle/emma.gradle +++ b/gradle/emma.gradle @@ -54,6 +54,11 @@ if (rootProject.getTasksByName('coverageReport', false).isEmpty()) { } } } + + if (!rootProject.buildDir.exists()) { + throw new GradleException("No coverage data. Run gradle with -Pcoverage=on if using coverageRepor"); + } + ant.emma(enabled: "true", verbosity: "info") { report(sourcepathref:"src.path") { fileset(dir: rootProject.buildDir) {