Skip to content

Commit

Permalink
[infra] apache#33309 automatically apply spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
je-ik committed Dec 6, 2024
1 parent d379968 commit cd02853
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,22 @@ tasks.register("checkSetup") {
dependsOn(":examples:java:wordCount")
}

// if not disabled make spotlessApply dependency of compileJava and compileTestJava
val disableSpotlessCheck: String by project
val isSpotlessDisabled = project.hasProperty("disableSpotlessCheck") &&
disableSpotlessCheck == "true"
if (!isSpotlessDisabled) {
subprojects {
afterEvaluate {
tasks.findByName("spotlessApply")?.let {
listOf("compileJava", "compileTestJava").forEach {
t -> tasks.findByName(t)?.let { f -> f.dependsOn("spotlessApply") }
}
}
}
}
}

// Generates external transform config
project.tasks.register("generateExternalTransformsConfig") {
dependsOn(":sdks:python:generateExternalTransformsConfig")
Expand Down
5 changes: 5 additions & 0 deletions runners/flink/flink_runner.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -422,3 +422,8 @@ createPipelineOptionsTableTask('Python')
// Update the pipeline options documentation before running the tests
test.dependsOn(generatePipelineOptionsTableJava)
test.dependsOn(generatePipelineOptionsTablePython)

// delegate spotlessApply to :runners:flink:spotlessApply
tasks.named("spotlessApply") {
dependsOn ":runners:flink:spotlessApply"
}

0 comments on commit cd02853

Please sign in to comment.