Skip to content

Commit e1245d9

Browse files
authored
Merge pull request #33310: [infra] #33309 automatically apply spotless
2 parents a806c0e + cd02853 commit e1245d9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

build.gradle.kts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,22 @@ tasks.register("checkSetup") {
647647
dependsOn(":examples:java:wordCount")
648648
}
649649

650+
// if not disabled make spotlessApply dependency of compileJava and compileTestJava
651+
val disableSpotlessCheck: String by project
652+
val isSpotlessDisabled = project.hasProperty("disableSpotlessCheck") &&
653+
disableSpotlessCheck == "true"
654+
if (!isSpotlessDisabled) {
655+
subprojects {
656+
afterEvaluate {
657+
tasks.findByName("spotlessApply")?.let {
658+
listOf("compileJava", "compileTestJava").forEach {
659+
t -> tasks.findByName(t)?.let { f -> f.dependsOn("spotlessApply") }
660+
}
661+
}
662+
}
663+
}
664+
}
665+
650666
// Generates external transform config
651667
project.tasks.register("generateExternalTransformsConfig") {
652668
dependsOn(":sdks:python:generateExternalTransformsConfig")

runners/flink/flink_runner.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,8 @@ createPipelineOptionsTableTask('Python')
422422
// Update the pipeline options documentation before running the tests
423423
test.dependsOn(generatePipelineOptionsTableJava)
424424
test.dependsOn(generatePipelineOptionsTablePython)
425+
426+
// delegate spotlessApply to :runners:flink:spotlessApply
427+
tasks.named("spotlessApply") {
428+
dependsOn ":runners:flink:spotlessApply"
429+
}

0 commit comments

Comments
 (0)