From fd8016618696f055311f61675fe3a2c9e9fa4028 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Mon, 24 Apr 2017 09:53:37 -0700 Subject: [PATCH] =?UTF-8?q?Warn=20if=20tools.jar=20can=E2=80=99t=20be=20fo?= =?UTF-8?q?und.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt index ed743b0f..5dacc296 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/apt/AptPlugin.kt @@ -159,8 +159,6 @@ class AptPlugin @Inject constructor(val dependencyManager: DependencyManager, va var success = true val flags = arrayListOf() kaptConfig?.let { config -> - - val generated = generated(project, context, config.outputDir) val generatedSources = generatedSources(project, context, config.outputDir).replace("//", "/") File(generatedSources).mkdirs() @@ -173,9 +171,12 @@ class AptPlugin @Inject constructor(val dependencyManager: DependencyManager, va flags.add(annotationProcessorDependency().jarFile.get().absolutePath) // Also need tools.jar on the plug-in classpath - jvm.toolsJar?.let { toolsJar -> + val toolsJar = jvm.toolsJar + if (toolsJar != null) { flags.add("-Xplugin") flags.add(toolsJar.absolutePath) + } else { + warn("Couldn't find tools.jar from the JDK") } aptJarDependencies(project).forEach {