Skip to content

Commit 9e92cd8

Browse files
fix(gradle-plugin): compileKotlin does not exist in Multiplatform (#1681)
* fix(gradle-plugin): compileKotlin does not exist in Multiplatform Instead the gradle plugin would use compileKotlinJvm * Update plugins/graphql-kotlin-gradle-plugin/src/main/kotlin/com/expediagroup/graphql/plugin/gradle/GraphQLGradlePlugin.kt --------- Co-authored-by: Dariusz Kuc <[email protected]>
1 parent b078626 commit 9e92cd8

File tree

1 file changed

+6
-1
lines changed
  • plugins/graphql-kotlin-gradle-plugin/src/main/kotlin/com/expediagroup/graphql/plugin/gradle

1 file changed

+6
-1
lines changed

plugins/graphql-kotlin-gradle-plugin/src/main/kotlin/com/expediagroup/graphql/plugin/gradle/GraphQLGradlePlugin.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ class GraphQLGradlePlugin : Plugin<Project> {
170170

171171
val configuration = project.configurations.getAt(GENERATE_SDL_CONFIGURATION)
172172
generateSDLTask.pluginClasspath.setFrom(configuration)
173-
generateSDLTask.dependsOn(project.tasks.named("compileKotlin"))
173+
val compileKotlinTask = project.tasks.findByName("compileKotlin") ?: project.tasks.findByName("compileKotlinJvm")
174+
if (compileKotlinTask != null) {
175+
generateSDLTask.dependsOn(compileKotlinTask)
176+
} else {
177+
project.logger.warn("compileKotlin/compileKotlinJvm tasks not found. Unable to auto-configure the generateSDLTask dependency on compile task.")
178+
}
174179
}
175180

176181
if (isAndroidProject) {

0 commit comments

Comments
 (0)