Skip to content

Commit

Permalink
BCV-1 added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-bach committed Mar 15, 2021
1 parent d7eb501 commit 08f5793
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ private fun Project.configureKotlinCompilation(
val projectName = project.name
val apiBuildDir = file(buildDir.resolve(API_DIR))
val apiBuild = task<KotlinApiBuildTask>("apiBuild", extension) {
isEnabled = apiCheckEnabled(extension)
// Do not execute task for empty umbrella modules
setOnlyIf { compilation.allKotlinSourceSets.any { it.kotlin.srcDirs.any { it.exists() } } }

isEnabled = apiCheckEnabled(extension)
// 'group' is not specified deliberately so it will be hidden from ./gradlew tasks
description =
"Builds Kotlin API for 'main' compilations of $projectName. Complementary task and shouldn't be called manually"
Expand Down Expand Up @@ -132,6 +132,7 @@ private fun Project.configureCheckTasks(
val projectName = project.name
val apiCheckDir = file(projectDir.resolve(API_DIR))
val apiCheck = task<ApiCompareCompareTask>("apiCheck") {
// Do not execute task for empty umbrella modules
setOnlyIf { apiBuild.get().isOnlyIf() }
isEnabled = apiCheckEnabled(extension)
group = "verification"
Expand All @@ -147,16 +148,15 @@ private fun Project.configureCheckTasks(
}

task<Sync>("apiDump") {
// Do not execute task for empty umbrella modules
setOnlyIf { apiBuild.get().isOnlyIf() }
isEnabled = apiCheckEnabled(extension)
group = "other"
description = "Syncs API from build dir to $API_DIR dir for $projectName"
from(apiBuildDir)
into(apiCheckDir)
dependsOn(apiBuild)
doFirst {
apiCheckDir.mkdirs()
}
doFirst { apiCheckDir.mkdirs() }
}
project.tasks.getByName("check").dependsOn(apiCheck)
}
Expand Down

0 comments on commit 08f5793

Please sign in to comment.