We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0500ff3 commit cd45c9dCopy full SHA for cd45c9d
src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy
@@ -555,7 +555,13 @@ public abstract class GenerateProtoTask extends DefaultTask {
555
List<File> protoFiles = sourceFiles.files.sort()
556
557
[builtins, plugins]*.each { plugin ->
558
- File outputDir = new File(getOutputDir(plugin))
+ String outputPath = getOutputDir(plugin)
559
+ File outputDir = new File(outputPath)
560
+ // protoc is capable of output generated files directly to a JAR file
561
+ // or ZIP archive if the output location ends with .jar/.zip
562
+ if (outputPath.endsWith(".jar") || outputPath.endsWith(".zip")) {
563
+ outputDir = outputDir.getParentFile()
564
+ }
565
outputDir.mkdirs()
566
}
567
0 commit comments