Skip to content

Commit

Permalink
fix(generator-accessor-plugin): make Kotlin compilation tasks depend …
Browse files Browse the repository at this point in the history
…on `generateAccessors`
  • Loading branch information
zlataovce committed Sep 23, 2023
1 parent b8cc667 commit a2ba190
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import me.kcra.takenaka.generator.common.provider.impl.SimpleMappingProvider
import me.kcra.takenaka.gradle.BuildConfig
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.tasks.compile.JavaCompile
Expand Down Expand Up @@ -81,6 +82,14 @@ class AccessorGeneratorPlugin : Plugin<Project> {
dependsOn(generateAccessors)
}

@Suppress("UNCHECKED_CAST")
runCatching { Class.forName("org.jetbrains.kotlin.gradle.tasks.KotlinCompile") as Class<Task> }
.onSuccess { klass ->
target.tasks.withType(klass) {
dependsOn(generateAccessors)
}
}

target.afterEvaluate {
val defaultLocation = layout.buildDirectory.dir("takenaka/output").get().asFile

Expand Down

0 comments on commit a2ba190

Please sign in to comment.