diff --git a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinMPPGradleProjectResolver.kt b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinMPPGradleProjectResolver.kt index 2bb90bf07ab..ee30bd1c7ee 100644 --- a/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinMPPGradleProjectResolver.kt +++ b/idea/idea-gradle/src/org/jetbrains/kotlin/idea/configuration/KotlinMPPGradleProjectResolver.kt @@ -714,7 +714,7 @@ open class KotlinMPPGradleProjectResolver : AbstractProjectResolverExtension() { ManualLanguageFeatureSetting(feature, LanguageFeature.State.ENABLED, arg) } it.useExperimental = languageSettings.experimentalAnnotationsInUse.toTypedArray() - it.pluginOptions = languageSettings.compilerPluginArguments.toTypedArray() + it.pluginOptions = languageSettings.compilerPluginArguments it.pluginClasspaths = languageSettings.compilerPluginClasspath.map(File::getPath).toTypedArray() } } @@ -733,12 +733,12 @@ open class KotlinMPPGradleProjectResolver : AbstractProjectResolverExtension() { sourceSetInfo.actualPlatforms.addSimplePlatforms(listOf(compilation.platform)) sourceSetInfo.isTestModule = compilation.isTestModule sourceSetInfo.compilerArguments = - createCompilerArguments(compilation.arguments.currentArguments, compilation.platform).also { + createCompilerArguments(compilation.arguments.currentArguments.toList(), compilation.platform).also { it.multiPlatform = true } - sourceSetInfo.dependencyClasspath = compilation.dependencyClasspath + sourceSetInfo.dependencyClasspath = compilation.dependencyClasspath.toList() sourceSetInfo.defaultCompilerArguments = - createCompilerArguments(compilation.arguments.defaultArguments, compilation.platform) + createCompilerArguments(compilation.arguments.defaultArguments.toList(), compilation.platform) sourceSetInfo.addSourceSets(compilation.sourceSets, compilation.fullName(), gradleModule, resolverCtx) } } @@ -760,7 +760,7 @@ open class KotlinMPPGradleProjectResolver : AbstractProjectResolverExtension() { private fun createCompilerArguments(args: List, platform: KotlinPlatform): CommonCompilerArguments { val compilerArguments = IdePlatformKindTooling.getTooling(platform).kind.argumentsClass.newInstance() - parseCommandLineArguments(args, compilerArguments) + parseCommandLineArguments(args.toList(), compilerArguments) return compilerArguments } diff --git a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModel.kt b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModel.kt index 2481cd7d79a..8fe384507b8 100644 --- a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModel.kt +++ b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModel.kt @@ -56,7 +56,7 @@ interface KotlinLanguageSettings : Serializable { val isProgressiveMode: Boolean val enabledLanguageFeatures: Set val experimentalAnnotationsInUse: Set - val compilerPluginArguments: List + val compilerPluginArguments: Array val compilerPluginClasspath: Set } @@ -67,15 +67,15 @@ interface KotlinCompilationOutput : Serializable { } interface KotlinCompilationArguments : Serializable { - val defaultArguments: List - val currentArguments: List + val defaultArguments: Array + val currentArguments: Array } interface KotlinCompilation : KotlinModule { val sourceSets: Collection val output: KotlinCompilationOutput val arguments: KotlinCompilationArguments - val dependencyClasspath: List + val dependencyClasspath: Array val disambiguationClassifier: String? val platform: KotlinPlatform val kotlinTaskProperties: KotlinTaskProperties diff --git a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt index 785d05a95ff..663a596d2ee 100644 --- a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt +++ b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelBuilder.kt @@ -155,7 +155,7 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService { getProgressiveMode(gradleLanguageSettings) as? Boolean ?: false, getEnabledLanguageFeatures(gradleLanguageSettings) as? Set ?: emptySet(), getExperimentalAnnotationsInUse?.invoke(gradleLanguageSettings) as? Set ?: emptySet(), - getCompilerPluginArguments?.invoke(gradleLanguageSettings) as? List ?: emptyList(), + (getCompilerPluginArguments?.invoke(gradleLanguageSettings) as? List ?: emptyList()).toTypedArray(), (getCompilerPluginClasspath?.invoke(gradleLanguageSettings) as? FileCollection)?.files ?: emptySet() ) } @@ -276,7 +276,7 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService { dependencies, output, arguments, - dependencyClasspath, + dependencyClasspath.toTypedArray(), kotlinTaskProperties ) } @@ -387,7 +387,7 @@ class KotlinMPPGradleModelBuilder : ModelBuilderService { val getDefaultArguments = compileTaskClass.getMethodOrNull("getDefaultSerializedCompilerArguments") val currentArguments = safelyGetArguments(compileKotlinTask, getCurrentArguments) val defaultArguments = safelyGetArguments(compileKotlinTask, getDefaultArguments) - return KotlinCompilationArgumentsImpl(defaultArguments, currentArguments) + return KotlinCompilationArgumentsImpl(defaultArguments.toTypedArray(), currentArguments.toTypedArray()) } private fun buildDependencyClasspath(compileKotlinTask: Task): List { diff --git a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt index 1aeb88ba7c2..04dca10f00f 100644 --- a/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt +++ b/idea/kotlin-gradle-tooling/src/KotlinMPPGradleModelImpl.kt @@ -46,7 +46,7 @@ data class KotlinLanguageSettingsImpl( override val isProgressiveMode: Boolean, override val enabledLanguageFeatures: Set, override val experimentalAnnotationsInUse: Set, - override val compilerPluginArguments: List, + override val compilerPluginArguments: Array, override val compilerPluginClasspath: Set ) : KotlinLanguageSettings { constructor(settings: KotlinLanguageSettings) : this( @@ -73,10 +73,13 @@ data class KotlinCompilationOutputImpl( } data class KotlinCompilationArgumentsImpl( - override val defaultArguments: List, - override val currentArguments: List + override val defaultArguments: Array, + override val currentArguments: Array ) : KotlinCompilationArguments { - constructor(arguments: KotlinCompilationArguments) : this(ArrayList(arguments.defaultArguments), ArrayList(arguments.currentArguments)) + constructor(arguments: KotlinCompilationArguments) : this( + arguments.defaultArguments, + arguments.currentArguments + ) } data class KotlinCompilationImpl( @@ -85,7 +88,7 @@ data class KotlinCompilationImpl( override val dependencies: Set, override val output: KotlinCompilationOutput, override val arguments: KotlinCompilationArguments, - override val dependencyClasspath: List, + override val dependencyClasspath: Array, override val kotlinTaskProperties: KotlinTaskProperties ) : KotlinCompilation { @@ -100,7 +103,7 @@ data class KotlinCompilationImpl( kotlinCompilation.dependencies.map { it.deepCopy(cloningCache) }.toSet(), KotlinCompilationOutputImpl(kotlinCompilation.output), KotlinCompilationArgumentsImpl(kotlinCompilation.arguments), - ArrayList(kotlinCompilation.dependencyClasspath), + kotlinCompilation.dependencyClasspath, KotlinTaskPropertiesImpl(kotlinCompilation.kotlinTaskProperties) ) { disambiguationClassifier = kotlinCompilation.disambiguationClassifier