Skip to content

Commit

Permalink
Do not early create prepareKotlinBuildScriptModel task
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed Jan 3, 2024
1 parent 18e328f commit a21a8b9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ class BuildConfigPlugin : Plugin<Project> {
.convention(findProperty("com.github.gmazzo.buildconfig.generateAtSync")?.toString()?.toBoolean() ?: true)
.finalizeValueOnRead()

rootProject.tasks.findByName("prepareKotlinBuildScriptModel")
?.dependsOn(extension.generateAtSync.map { if (it) tasks.withType<BuildConfigTask>() else files() })
if (rootProject.tasks.names.contains("prepareKotlinBuildScriptModel")) {
rootProject.tasks.named("prepareKotlinBuildScriptModel") {
it.dependsOn(extension.generateAtSync
.map { enabled -> if (enabled) tasks.withType<BuildConfigTask>() else files() })
}
}

plugins.withId("java") {
JavaHandler(project, extension).configure(sourceSets)
Expand Down

0 comments on commit a21a8b9

Please sign in to comment.