Skip to content

Commit bfd2c1b

Browse files
committed
Polish "Improve GenerateProtoTask relocatability by clearing javaExecutablePath"
See gh-49842 Signed-off-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
1 parent 20a922c commit bfd2c1b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

buildSrc/src/main/java/org/springframework/boot/build/ProtobufConventions.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ class ProtobufConventions {
3030
void apply(Project project) {
3131
project.getPlugins().withId("com.google.protobuf", (plugin) -> {
3232
ProtobufExtension protobuf = project.getExtensions().getByType(ProtobufExtension.class);
33-
34-
// Clears javaExecutablePath to prevent build cache misses across machines.
35-
// This is safe as long as the Protobuf tool is NOT configured as a JAR.
36-
// See: https://github.com/google/protobuf-gradle-plugin/issues/785
37-
protobuf.getJavaExecutablePath().convention("");
33+
removeUnusedMachineSpecificConfiguration(protobuf);
3834
});
3935
}
4036

37+
// See: https://github.com/google/protobuf-gradle-plugin/issues/785
38+
private void removeUnusedMachineSpecificConfiguration(ProtobufExtension protobuf) {
39+
protobuf.getJavaExecutablePath().convention("");
40+
}
41+
4142
}

0 commit comments

Comments
 (0)