From 7535778ed4c4d9815b7e41c880c00debdd6a3c7b Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Fri, 17 Mar 2017 16:17:19 +0300 Subject: [PATCH] AllOpen, NoArg: Check for the Gradle plugin in the classpath properly Path segments in the plugin classpath entries are separated by the system file separator, not by '/'. This fixes KT-16901 --- .../src/idePluginUtils.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/annotation-based-compiler-plugins-ide-support/src/idePluginUtils.kt b/plugins/annotation-based-compiler-plugins-ide-support/src/idePluginUtils.kt index e676b69000c..142556688c6 100644 --- a/plugins/annotation-based-compiler-plugins-ide-support/src/idePluginUtils.kt +++ b/plugins/annotation-based-compiler-plugins-ide-support/src/idePluginUtils.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.annotation.plugin.ide import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments import org.jetbrains.kotlin.idea.facet.KotlinFacet +import java.io.File internal class AnnotationBasedCompilerPluginSetup(val annotationFqNames: List, val classpath: List) @@ -40,7 +41,7 @@ internal fun modifyCompilerArgumentsForPlugin( val newPluginOptions = oldPluginOptions + annotationOptions val oldPluginClasspaths = (commonArguments.pluginClasspaths ?: emptyArray()).filterTo(mutableListOf()) { - !it.substringAfterLast('/', missingDelimiterValue = "").matches("(kotlin-)?(maven-)?$pluginName-.*\\.jar".toRegex()) + !it.substringAfterLast(File.separatorChar, missingDelimiterValue = "").matches("(kotlin-)?(maven-)?$pluginName-.*\\.jar".toRegex()) } val newPluginClasspaths = oldPluginClasspaths + (setup?.classpath ?: emptyList())