mirror of https://github.com/grpc/grpc-java.git
build.gradle: Use proto task output instead of hard-coding path
This removes the need to specify dependsOn explicitly, because the task input carries the dependency.
This commit is contained in:
parent
6e486cba48
commit
3f0e90d54e
10
build.gradle
10
build.gradle
|
|
@ -89,13 +89,9 @@ subprojects {
|
|||
all().each { task ->
|
||||
String variantOrSourceSet = isAndroid ? task.variant.name : task.sourceSet.name
|
||||
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"
|
||||
from task
|
||||
into "$generatedSourcePath/$variantOrSourceSet"
|
||||
include "grpc/"
|
||||
}
|
||||
syncGeneratedSources.configure {
|
||||
dependsOn syncTask
|
||||
|
|
|
|||
Loading…
Reference in New Issue