Skip to content

Fix bugs in our protobuf code generator integration #1691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ subprojects {
all().each { task ->
task.dependsOn ':grpc-compiler:java_pluginExecutable'
// Delete the generated sources first, so that we can be alerted if they are not re-compiled.
task.dependsOn deleteGeneratedSource
task.dependsOn 'deleteGeneratedSource' + task.sourceSet.name
// Recompile protos when the codegen has been changed
task.inputs.file javaPluginPath
// Recompile protos when build.gradle has been changed, because
Expand All @@ -94,8 +94,10 @@ subprojects {
generatedFilesBaseDir = generatedSourcePath
}

task deleteGeneratedSource << {
project.delete project.fileTree(dir: generatedSourcePath)
sourceSets.each { sourceSet ->
task "deleteGeneratedSource${sourceSet.name}" << {
project.delete project.fileTree(dir: generatedSourcePath + '/' + sourceSet.name)
}
}
} else {
// Otherwise, we just use the checked-in generated code.
Expand Down
5 changes: 4 additions & 1 deletion compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ protobuf {
}
}
generateProtoTasks {
all()*.dependsOn 'java_pluginExecutable'
all().each { task ->
task.dependsOn 'java_pluginExecutable'
task.inputs.file javaPluginPath
}
ofSourceSet('test')*.plugins {
grpc {}
}
Expand Down