Skip to content

Commit 3775e74

Browse files
committed
find ksp configurations as they are added
1 parent cc8ae15 commit 3775e74

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

plugins/dataframe-gradle-plugin/src/main/kotlin/org/jetbrains/dataframe/gradle/ConvenienceSchemaGeneratorPlugin.kt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,23 @@ class ConvenienceSchemaGeneratorPlugin : Plugin<Project> {
6767
isMultiplatform -> listOf("kspJvm", "kspJvmTest")
6868
else -> listOf("ksp", "kspTest")
6969
}
70+
71+
val cfgsToAdd = configs.toMutableSet()
72+
7073
configs.forEach { cfg ->
71-
try {
72-
target.configurations.getByName(cfg).dependencies.add(
73-
target.dependencies.create(
74-
"org.jetbrains.kotlinx.dataframe:symbol-processor-all:$preprocessorVersion",
75-
),
76-
)
77-
} catch (e: UnknownConfigurationException) {
78-
target.logger.warn(
79-
"Configuration '$cfg' not found. Please make sure the KSP plugin is applied.",
74+
target.configurations.named { it == cfg }.configureEach {
75+
cfgsToAdd.remove(cfg)
76+
dependencies.add(
77+
target.dependencies.create("org.jetbrains.kotlinx.dataframe:symbol-processor-all:$preprocessorVersion")
8078
)
8179
}
8280
}
81+
target.gradle.projectsEvaluated {
82+
cfgsToAdd.forEach { cfg ->
83+
target.logger.warn("Configuration '$cfg' was never found. Please make sure the KSP plugin is applied.")
84+
}
85+
}
86+
8387
target.logger.info("Added DataFrame dependency to the KSP plugin.")
8488
target.extensions.getByType<KspExtension>().arg(
8589
"dataframe.resolutionDir",

0 commit comments

Comments
 (0)