From b0ac3eb8fc7eb18aef57b57f5edb05e2ea3b35d9 Mon Sep 17 00:00:00 2001 From: Sheridan C Rawlins Date: Tue, 17 Dec 2024 09:45:37 -0800 Subject: [PATCH] [Fix 751] Add an experimentalEditions flag to allow use of edition to declare the proto syntax. - See https://protobuf.dev/editions/overview/ --- .../com/google/protobuf/gradle/GenerateProtoTask.groovy | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy b/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy index 0ce54372..4ba80c10 100644 --- a/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy +++ b/src/main/groovy/com/google/protobuf/gradle/GenerateProtoTask.groovy @@ -160,6 +160,12 @@ public abstract class GenerateProtoTask extends DefaultTask { */ @Input boolean includeImports + + /** + * If true, protobuf files will use edition to declare their syntax. + */ + @Input + boolean experimentalEditions } @Internal("Handled as input via getDescriptorSetOptionsForCaching()") @@ -645,6 +651,9 @@ public abstract class GenerateProtoTask extends DefaultTask { if (descriptorSetOptions.includeSourceInfo) { baseCmd += "--include_source_info" } + if (descriptorSetOptions.experimentalEditions) { + baseCmd += "--experimental_editions" + } } List> cmds = generateCmds(baseCmd, protoFiles, getCmdLengthLimit())