Bläddra i källkod

Support "edition2024". (#1825)

- Regenerate the feature set tables.
- Have the generator report the support.
- Tell the conformance runner to include 2024 checks.
Thomas Van Lenten 7 månader sedan
förälder
incheckning
aac051b251

+ 3 - 3
Makefile

@@ -314,7 +314,7 @@ Sources/SwiftProtobufPluginLibrary/PluginLibEditionDefaults.swift: build ${PROTO
 	@${PROTOC} \
 		--edition_defaults_out=PluginLibEditionDefaults.bin \
 		--edition_defaults_minimum=PROTO2 \
-		--edition_defaults_maximum=2023 \
+		--edition_defaults_maximum=2024 \
 		-I Protos/Sources/SwiftProtobuf \
 		Protos/Sources/SwiftProtobuf/google/protobuf/descriptor.proto
 	@rm -f $@
@@ -330,7 +330,7 @@ Tests/SwiftProtobufPluginLibraryTests/PluginLibTestingEditionDefaults.swift: bui
 	@${PROTOC} \
 		--edition_defaults_out=PluginLibTestingEditionDefaults.bin \
 		--edition_defaults_minimum=PROTO2 \
-		--edition_defaults_maximum=2023 \
+		--edition_defaults_maximum=2024 \
 		-I Protos/Sources/SwiftProtobuf \
 		-I Protos/Tests/SwiftProtobufPluginLibraryTests \
 		Protos/Tests/SwiftProtobufPluginLibraryTests/test_features.proto
@@ -615,7 +615,7 @@ test-conformance: build check-for-protobuf-checkout Sources/Conformance/failure_
 	  --enforce_recommended \
 	  --failure_list Sources/Conformance/failure_list_swift.txt \
 	  --text_format_failure_list Sources/Conformance/text_format_failure_list_swift.txt \
-	  --maximum_edition 2023 \
+	  --maximum_edition 2024 \
 	  $(SWIFT_CONFORMANCE_PLUGIN)
 
 # Validate the CocoaPods podspec file against the current tree state.

+ 3 - 1
Sources/SwiftProtobufPluginLibrary/PluginLibEditionDefaults.swift

@@ -8,5 +8,7 @@ let bundledFeatureSetDefaultBytes: [UInt8] = [
   0x10, 0x01, 0x18, 0x01, 0x20, 0x02, 0x28, 0x01, 0x30, 0x01, 0x38, 0x02,
   0x40, 0x01, 0x0a, 0x17, 0x18, 0xe8, 0x07, 0x22, 0x0c, 0x08, 0x01, 0x10,
   0x01, 0x18, 0x01, 0x20, 0x02, 0x28, 0x01, 0x30, 0x01, 0x2a, 0x04, 0x38,
-  0x02, 0x40, 0x01, 0x20, 0xe6, 0x07, 0x28, 0xe8, 0x07
+  0x02, 0x40, 0x01, 0x0a, 0x17, 0x18, 0xe9, 0x07, 0x22, 0x10, 0x08, 0x01,
+  0x10, 0x01, 0x18, 0x01, 0x20, 0x02, 0x28, 0x01, 0x30, 0x01, 0x38, 0x01,
+  0x40, 0x02, 0x2a, 0x00, 0x20, 0xe6, 0x07, 0x28, 0xe9, 0x07
 ]

+ 1 - 1
Sources/protoc-gen-swift/SwiftGeneratorPlugin.swift

@@ -51,7 +51,7 @@ struct SwiftGeneratorPlugin: CodeGenerator {
     ]
 
     var supportedEditionRange: ClosedRange<Google_Protobuf_Edition> {
-        Google_Protobuf_Edition.proto2...Google_Protobuf_Edition.edition2023
+        Google_Protobuf_Edition.proto2...Google_Protobuf_Edition.edition2024
     }
 
     var version: String? { "\(SwiftProtobuf.Version.versionString)" }

+ 5 - 2
Tests/SwiftProtobufPluginLibraryTests/PluginLibTestingEditionDefaults.swift

@@ -12,6 +12,9 @@ let testFeatureSetDefaultBytes: [UInt8] = [
   0x28, 0x01, 0x0a, 0x29, 0x18, 0xe8, 0x07, 0x22, 0x1a, 0x08, 0x01, 0x10,
   0x01, 0x18, 0x01, 0x20, 0x02, 0x28, 0x01, 0x30, 0x01, 0xfa, 0xf0, 0x04,
   0x0a, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x2a,
-  0x08, 0x38, 0x02, 0x40, 0x01, 0xfa, 0xf0, 0x04, 0x00, 0x20, 0xe6, 0x07,
-  0x28, 0xe8, 0x07
+  0x08, 0x38, 0x02, 0x40, 0x01, 0xfa, 0xf0, 0x04, 0x00, 0x0a, 0x29, 0x18,
+  0xe9, 0x07, 0x22, 0x1e, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x02,
+  0x28, 0x01, 0x30, 0x01, 0x38, 0x01, 0x40, 0x02, 0xfa, 0xf0, 0x04, 0x0a,
+  0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x2a, 0x04,
+  0xfa, 0xf0, 0x04, 0x00, 0x20, 0xe6, 0x07, 0x28, 0xe9, 0x07
 ]