From ff2b3855d3039025fb59f3113cdf41491f16f039 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 29 Oct 2019 11:37:00 +0100 Subject: Fix guessing the build folder. --- .../src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kvision-tools/kvision-compiler-plugin/src') diff --git a/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt b/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt index eba66a9b..84d31593 100644 --- a/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt +++ b/kvision-tools/kvision-compiler-plugin/src/main/kotlin/pl/treksoft/kvision/plugin/KVProcessor.kt @@ -21,7 +21,7 @@ */ package pl.treksoft.kvision.plugin -import de.jensklingenberg.mpapt.common.guessingBuildFolder +import de.jensklingenberg.mpapt.common.canonicalFilePath import de.jensklingenberg.mpapt.common.methods import de.jensklingenberg.mpapt.model.AbstractProcessor import de.jensklingenberg.mpapt.model.Element @@ -62,7 +62,9 @@ class KVProcessor : AbstractProcessor() { && it.classDescriptor.name.asString().endsWith("Service") ) { val cl = it.classDescriptor - val genRootDir = File(cl.guessingBuildFolder(), "generated-src").apply { + val projectFolder = cl.canonicalFilePath()?.split("${File.separator}src")?.get(0) ?: "" + val buildFolder = "$projectFolder${File.separator}build" + val genRootDir = File(buildFolder, "generated-src").apply { mkdirs() } val packageName = cl.containingDeclaration.fqNameSafe.asString() -- cgit