Skip to content

Commit 1e5ebec

Browse files
committed
adding try catch
1 parent 408ec9c commit 1e5ebec

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,20 @@ class ConvenienceSchemaGeneratorPlugin : Plugin<Project> {
3030
// configure it to depend on symbol-processor-all
3131
target.plugins.whenPluginAdded {
3232
if ("com.google.devtools.ksp" in this.javaClass.packageName) {
33-
target.configurations.getByName("ksp").dependencies.add(
34-
target.dependencies.create("org.jetbrains.kotlinx.dataframe:symbol-processor-all:$preprocessorVersion")
35-
)
36-
target.configurations.getByName("kspTest").dependencies.add(
37-
target.dependencies.create("org.jetbrains.kotlinx.dataframe:symbol-processor-all:$preprocessorVersion")
38-
)
33+
try {
34+
target.configurations.getByName("ksp").dependencies.add(
35+
target.dependencies.create("org.jetbrains.kotlinx.dataframe:symbol-processor-all:$preprocessorVersion")
36+
)
37+
} catch (e: UnknownConfigurationException) {
38+
target.logger.warn("Configuration 'ksp' not found. Please make sure the KSP plugin is applied.")
39+
}
40+
try {
41+
target.configurations.getByName("kspTest").dependencies.add(
42+
target.dependencies.create("org.jetbrains.kotlinx.dataframe:symbol-processor-all:$preprocessorVersion")
43+
)
44+
} catch (e: UnknownConfigurationException) {
45+
target.logger.warn("Configuration 'kspTest' not found. Please make sure the KSP plugin is applied.")
46+
}
3947
target.logger.info("Added DataFrame dependency to the KSP plugin.")
4048
}
4149
}

0 commit comments

Comments
 (0)