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 ->
|
all().each { task ->
|
||||||
String variantOrSourceSet = isAndroid ? task.variant.name : task.sourceSet.name
|
String variantOrSourceSet = isAndroid ? task.variant.name : task.sourceSet.name
|
||||||
def syncTask = project.tasks.register("syncGeneratedSources${variantOrSourceSet}", Sync) {
|
def syncTask = project.tasks.register("syncGeneratedSources${variantOrSourceSet}", Sync) {
|
||||||
from "$buildDir/generated/source/proto/${variantOrSourceSet}/grpc"
|
from task
|
||||||
into "$generatedSourcePath/${variantOrSourceSet}/grpc"
|
into "$generatedSourcePath/$variantOrSourceSet"
|
||||||
String source = GUtil.toCamelCase(variantOrSourceSet)
|
include "grpc/"
|
||||||
if (source == "Main") {
|
|
||||||
source = ""
|
|
||||||
}
|
|
||||||
dependsOn "generate${source}Proto"
|
|
||||||
}
|
}
|
||||||
syncGeneratedSources.configure {
|
syncGeneratedSources.configure {
|
||||||
dependsOn syncTask
|
dependsOn syncTask
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue