Skip to content

Commit

Permalink
Improved generateAtSync by using prepareKotlinIdeaImport hook task
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed Jan 12, 2024
1 parent d101d0f commit fe48faa
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class BuildConfigPlugin : Plugin<Project> {
.convention(findProperty("com.github.gmazzo.buildconfig.generateAtSync")?.toString()?.toBoolean() ?: true)
.finalizeValueOnRead()

if (rootProject.tasks.names.contains("prepareKotlinBuildScriptModel")) {
rootProject.tasks.named("prepareKotlinBuildScriptModel") {
it.dependsOn(extension.generateAtSync
.map { enabled -> if (enabled) tasks.withType<BuildConfigTask>() else files() })
// generate at sync
afterEvaluate {
if (extension.generateAtSync.get()) {
tasks.maybeCreate("prepareKotlinIdeaImport").dependsOn(tasks.withType<BuildConfigTask>())
}
}

Expand Down

0 comments on commit fe48faa

Please sign in to comment.