From 5c19369b0d6d190212bb081f591db89e7f7ef012 Mon Sep 17 00:00:00 2001 From: Jens Klingenberg Date: Mon, 9 Sep 2024 21:08:28 +0200 Subject: [PATCH] Replace commonMain with SourceSet constant --- .../jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ktorfit-gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt b/ktorfit-gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt index d5c225434..8c2cf9640 100644 --- a/ktorfit-gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt +++ b/ktorfit-gradle-plugin/src/main/java/de/jensklingenberg/ktorfit/gradle/KtorfitGradlePlugin.kt @@ -5,6 +5,7 @@ import org.gradle.api.Project import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.dsl.KotlinSingleTargetExtension import org.jetbrains.kotlin.gradle.dsl.kotlinExtension +import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.targets import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask import java.util.Locale.US @@ -107,8 +108,10 @@ class KtorfitGradlePlugin : Plugin { } } - kotlinExtension.sourceSets.named("commonMain").configure { - kotlin.srcDir("${layout.buildDirectory.get()}/generated/ksp/metadata/commonMain/kotlin") + kotlinExtension.sourceSets.named(KotlinSourceSet.COMMON_MAIN_SOURCE_SET_NAME).configure { + kotlin.srcDir( + "${layout.buildDirectory.get()}/generated/ksp/metadata/${KotlinSourceSet.COMMON_MAIN_SOURCE_SET_NAME}/kotlin" + ) } }