File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/main/kotlin/com/tschuchort/compiletesting Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ import java.net.URI
3737import java.net.URLClassLoader
3838import java.nio.file.Files
3939import java.nio.file.Path
40+ import java.nio.file.Paths
4041import javax.annotation.processing.Processor
4142import javax.tools.*
4243
@@ -471,18 +472,18 @@ class KotlinCompilation {
471472 )
472473
473474 val resourcesPath = when (resourcesUri.scheme) {
474- " jar" -> resourcesUri.schemeSpecificPart.removeSurrounding( " file: " , " ! " )
475- " file" -> resourcesUri.schemeSpecificPart
475+ " jar" -> Paths .get( URI .create( resourcesUri.schemeSpecificPart.removeSuffix( " ! " )) )
476+ " file" -> Paths .get(resourcesUri)
476477 else -> throw IllegalStateException (
477478 " Don't know how to handle protocol of ComponentRegistrar plugin. " +
478479 " Did you include this library in a weird way? Only jar and file path are supported."
479480 )
480- }.removePrefix( " / " )
481+ }.toAbsolutePath( )
481482
482483 val k2JvmArgs = commonK2JVMArgs().also {
483484 it.freeArgs = sourcePaths
484485
485- it.pluginClasspaths = (it.pluginClasspaths?.toList() ? : emptyList<String >() + resourcesPath)
486+ it.pluginClasspaths = (it.pluginClasspaths?.toList() ? : emptyList<String >() + resourcesPath.toString() )
486487 .distinct().toTypedArray()
487488 }
488489
You can’t perform that action at this time.
0 commit comments