diff --git a/plugins/dataframe-gradle-plugin/src/main/kotlin/org/jetbrains/dataframe/gradle/ConvenienceSchemaGeneratorPlugin.kt b/plugins/dataframe-gradle-plugin/src/main/kotlin/org/jetbrains/dataframe/gradle/ConvenienceSchemaGeneratorPlugin.kt index 0257465a8e..b05d5c2a10 100644 --- a/plugins/dataframe-gradle-plugin/src/main/kotlin/org/jetbrains/dataframe/gradle/ConvenienceSchemaGeneratorPlugin.kt +++ b/plugins/dataframe-gradle-plugin/src/main/kotlin/org/jetbrains/dataframe/gradle/ConvenienceSchemaGeneratorPlugin.kt @@ -3,7 +3,6 @@ package org.jetbrains.dataframe.gradle import com.google.devtools.ksp.gradle.KspExtension import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.artifacts.UnknownConfigurationException import org.gradle.kotlin.dsl.getByType import java.util.Properties @@ -67,19 +66,27 @@ class ConvenienceSchemaGeneratorPlugin : Plugin { isMultiplatform -> listOf("kspJvm", "kspJvmTest") else -> listOf("ksp", "kspTest") } + + val cfgsToAdd = configs.toMutableSet() + configs.forEach { cfg -> - try { - target.configurations.getByName(cfg).dependencies.add( + target.configurations.named { it == cfg }.configureEach { + cfgsToAdd.remove(cfg) + dependencies.add( target.dependencies.create( "org.jetbrains.kotlinx.dataframe:symbol-processor-all:$preprocessorVersion", ), ) - } catch (e: UnknownConfigurationException) { + } + } + target.gradle.projectsEvaluated { + cfgsToAdd.forEach { cfg -> target.logger.warn( - "Configuration '$cfg' not found. Please make sure the KSP plugin is applied.", + "Configuration '$cfg' was never found. Please make sure the KSP plugin is applied.", ) } } + target.logger.info("Added DataFrame dependency to the KSP plugin.") target.extensions.getByType().arg( "dataframe.resolutionDir",