From eb2ed0d05460001aebaf46c90360e46e1e9355b9 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sun, 17 Apr 2016 19:05:58 +0900 Subject: [PATCH] Catch runtime exception --- .../org/kt3k/ebean/enhance/EnhanceEbeanTask.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/org/kt3k/ebean/enhance/EnhanceEbeanTask.kt b/src/main/kotlin/org/kt3k/ebean/enhance/EnhanceEbeanTask.kt index 04769de..97f78dd 100644 --- a/src/main/kotlin/org/kt3k/ebean/enhance/EnhanceEbeanTask.kt +++ b/src/main/kotlin/org/kt3k/ebean/enhance/EnhanceEbeanTask.kt @@ -20,11 +20,15 @@ open class EnhanceEbeanTask : DefaultTask() { "classpath" to project.configurations.getByName(CONFIGURATION_NAME).asPath )) - project.ant.invokeMethod(antTaskName, mapOf( - "classSource" to project.buildDir.absolutePath + classFilePath, - "packages" to ext(project).packages, - "transformArgs" to ext(project).transformArgs - )) + try { + project.ant.invokeMethod(antTaskName, mapOf( + "classSource" to project.buildDir.absolutePath + classFilePath, + "packages" to ext(project).packages, + "transformArgs" to ext(project).transformArgs + )) + } catch (e: RuntimeException) { + logger.info(e.message); + } } }