From 1f81ac2cc07a01cfd68ec6933f1d6d4dc4b7bbc0 Mon Sep 17 00:00:00 2001
From: Clinton Alexander <admin@clintonio.com>
Date: Mon, 21 Nov 2016 13:47:54 +0000
Subject: [PATCH] Fixed an exception caused when quasar plugin runs on root.

---
 .../groovy/net/corda/plugins/QuasarPlugin.groovy    | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/gradle-plugins/quasar-utils/src/main/groovy/net/corda/plugins/QuasarPlugin.groovy b/gradle-plugins/quasar-utils/src/main/groovy/net/corda/plugins/QuasarPlugin.groovy
index 852ff69b25..d8200cef7b 100644
--- a/gradle-plugins/quasar-utils/src/main/groovy/net/corda/plugins/QuasarPlugin.groovy
+++ b/gradle-plugins/quasar-utils/src/main/groovy/net/corda/plugins/QuasarPlugin.groovy
@@ -46,13 +46,14 @@ class QuasarPlugin implements Plugin<Project> {
             ant.taskdef(name:'scanSuspendables', classname:'co.paralleluniverse.fibers.instrument.SuspendablesScanner',
                     classpath: "${project.sourceSets.main.output.classesDir}:${project.sourceSets.main.output.resourcesDir}:${project.configurations.runtime.asPath}")
             project.delete "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers"
-            ant.scanSuspendables(
-                    auto:false,
-                    suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables",
-                    supersFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") {
-                fileset(dir: project.sourceSets.main.output.classesDir)
+            if(project.sourceSets.main.output.classesDir.exists()) {
+                ant.scanSuspendables(
+                        auto:false,
+                        suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables",
+                        supersFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") {
+                    fileset(dir: project.sourceSets.main.output.classesDir)
+                }
             }
-
         }
 
         project.jar.dependsOn project.quasarScan