Repository navigation
Add J2ObjC companion and KNP compatibility alias for ExtensionRegistryLite to match Kotlin/Native protobuf codegen in Objective-C and Swift. - #2944
Open
copybara-service[bot] wants to merge 1 commit into
Conversation
…ryLite` to match Kotlin/Native protobuf codegen in Objective-C and Swift. Objective-C and Swift code migrating from J2ObjC protos to Kotlin/Native protos cannot call `ExtensionRegistryLite.getGeneratedRegistry()` through a single API because J2ObjC did not expose `KNPComGoogleProtobufExtensionRegistryLite`, its `companion`/`shared` properties, or a transitive include from `GeneratedMessage.h`. - Declare `ComGoogleProtobufExtensionRegistryLiteCompanionProtocol` (`getGeneratedRegistry`), `companion` and `shared` class properties on `ComGoogleProtobufExtensionRegistryLite`, and `@compatibility_alias` for `KNPComGoogleProtobufExtensionRegistryLite` and `KNPComGoogleProtobufExtensionRegistryLiteCompanion`. - Return `ComGoogleProtobufExtensionRegistryLite_getEmptyRegistry()` instead of `nil` in `GeneratedExtensionRegistryLoader.m` when zero extensions are linked so `+getGeneratedRegistry` is nonnull, matching Java and Kotlin/Native. - Include `com/google/protobuf/ExtensionRegistryLite.h` from `GeneratedMessage.h` so `KNPComGoogleProtobufExtensionRegistryLite` is available from generated proto headers. - Add Objective-C and Swift round-trip extension parse tests using `KNPComGoogleProtobufExtensionRegistryLite.companion.getGeneratedRegistry`. PiperOrigin-RevId: 1029062286
copybara-service
Bot
force-pushed
the
test_1029062286
branch
from
November 24, 2026 17:19
4a24d89 to
413e7f5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add J2ObjC companion and KNP compatibility alias for
ExtensionRegistryLiteto match Kotlin/Native protobuf codegen in Objective-C and Swift.Objective-C and Swift code migrating from J2ObjC protos to Kotlin/Native protos cannot call
ExtensionRegistryLite.getGeneratedRegistry()through a single API because J2ObjC did not exposeKNPComGoogleProtobufExtensionRegistryLite, itscompanion/sharedproperties, or a transitive include fromGeneratedMessage.h.ComGoogleProtobufExtensionRegistryLiteCompanionProtocol(getGeneratedRegistry),companionandsharedclass properties onComGoogleProtobufExtensionRegistryLite, and@compatibility_aliasforKNPComGoogleProtobufExtensionRegistryLiteandKNPComGoogleProtobufExtensionRegistryLiteCompanion.ComGoogleProtobufExtensionRegistryLite_getEmptyRegistry()instead ofnilinGeneratedExtensionRegistryLoader.mwhen zero extensions are linked so+getGeneratedRegistryis nonnull, matching Java and Kotlin/Native.com/google/protobuf/ExtensionRegistryLite.hfromGeneratedMessage.hsoKNPComGoogleProtobufExtensionRegistryLiteis available from generated proto headers.KNPComGoogleProtobufExtensionRegistryLite.companion.getGeneratedRegistry.