Skip to content

Commit

Permalink
build.gradle: Add missing dependsOn for generated code sync
Browse files Browse the repository at this point in the history
When messing with error prone for another commit, Gradle started
producing a clear warning the dependsOn was missing. But the warning
was not reliable. However, even when no warning was printed it is clear
the task was broken.
  • Loading branch information
ejona86 authored Jan 10, 2022
1 parent e0dca93 commit 9e83758
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
}

import net.ltgt.gradle.errorprone.CheckSeverity
import org.gradle.util.GUtil

subprojects {
apply plugin: "checkstyle"
Expand Down Expand Up @@ -97,6 +98,11 @@ subprojects {
def syncTask = project.tasks.register("syncGeneratedSources${variantOrSourceSet}", Sync) {
from "$buildDir/generated/source/proto/${variantOrSourceSet}/grpc"
into "$generatedSourcePath/${variantOrSourceSet}/grpc"
String source = GUtil.toCamelCase(variantOrSourceSet)
if (source == "Main") {
source = ""
}
dependsOn "generate${source}Proto"
}
syncGeneratedSources.dependsOn syncTask

Expand Down

0 comments on commit 9e83758

Please sign in to comment.