From 0c6147cd981d2e9250258301f8902b5c3022af68 Mon Sep 17 00:00:00 2001 From: Dominic Mayhew Date: Tue, 9 Jan 2024 11:44:51 -0800 Subject: [PATCH] Add support for additional well known types Some well known types with message definitions in Protobuf source code were not being converted into Haskell. Proto definitions that depend on those types (e.g., FieldMask) failed to build. This commit adds those types to the auto-generated code so proto definitions that depend on them work. --- proto-lens-protobuf-types/package.yaml | 19 ++++++++++-- .../proto-lens-protobuf-types.cabal | 30 +++++++++++++++---- 2 files changed, 41 insertions(+), 8 deletions(-) diff --git a/proto-lens-protobuf-types/package.yaml b/proto-lens-protobuf-types/package.yaml index 151adaed..c795b97e 100644 --- a/proto-lens-protobuf-types/package.yaml +++ b/proto-lens-protobuf-types/package.yaml @@ -13,13 +13,17 @@ github: google/proto-lens/proto-lens-protobuf-types extra-source-files: - Changelog.md - proto-src/google/protobuf/any.proto + - proto-src/google/protobuf/api.proto - proto-src/google/protobuf/compiler/plugin.proto - proto-src/google/protobuf/descriptor.proto - proto-src/google/protobuf/duration.proto - proto-src/google/protobuf/empty.proto - - proto-src/google/protobuf/wrappers.proto + - proto-src/google/protobuf/field_mask.proto + - proto-src/google/protobuf/source_context.proto - proto-src/google/protobuf/struct.proto - proto-src/google/protobuf/timestamp.proto + - proto-src/google/protobuf/type.proto + - proto-src/google/protobuf/wrappers.proto custom-setup: dependencies: @@ -44,6 +48,8 @@ library: generated-exposed-modules: - Proto.Google.Protobuf.Any - Proto.Google.Protobuf.Any_Fields + - Proto.Google.Protobuf.Api + - Proto.Google.Protobuf.Api_Fields - Proto.Google.Protobuf.Compiler.Plugin - Proto.Google.Protobuf.Compiler.Plugin_Fields - Proto.Google.Protobuf.Descriptor @@ -52,12 +58,19 @@ library: - Proto.Google.Protobuf.Duration_Fields - Proto.Google.Protobuf.Empty - Proto.Google.Protobuf.Empty_Fields - - Proto.Google.Protobuf.Wrappers - - Proto.Google.Protobuf.Wrappers_Fields + - Proto.Google.Protobuf.FieldMask + - Proto.Google.Protobuf.FieldMask_Fields + - Proto.Google.Protobuf.SourceContext + - Proto.Google.Protobuf.SourceContext_Fields - Proto.Google.Protobuf.Struct - Proto.Google.Protobuf.Struct_Fields - Proto.Google.Protobuf.Timestamp - Proto.Google.Protobuf.Timestamp_Fields + - Proto.Google.Protobuf.Type + - Proto.Google.Protobuf.Type_Fields + - Proto.Google.Protobuf.Wrappers + - Proto.Google.Protobuf.Wrappers_Fields + # Prevent hpack from putting Paths_* in the other-modules. # Otherwise, "cabal check" complains (preventing upload to Hackage) # because it expects it to be listed in autogen-modules. diff --git a/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal b/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal index af0a8608..6f81fe0d 100644 --- a/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal +++ b/proto-lens-protobuf-types/proto-lens-protobuf-types.cabal @@ -20,13 +20,17 @@ build-type: Custom extra-source-files: Changelog.md proto-src/google/protobuf/any.proto + proto-src/google/protobuf/api.proto proto-src/google/protobuf/compiler/plugin.proto proto-src/google/protobuf/descriptor.proto proto-src/google/protobuf/duration.proto proto-src/google/protobuf/empty.proto - proto-src/google/protobuf/wrappers.proto + proto-src/google/protobuf/field_mask.proto + proto-src/google/protobuf/source_context.proto proto-src/google/protobuf/struct.proto proto-src/google/protobuf/timestamp.proto + proto-src/google/protobuf/type.proto + proto-src/google/protobuf/wrappers.proto source-repository head type: git @@ -45,6 +49,8 @@ library Data.ProtoLens.Descriptor Proto.Google.Protobuf.Any Proto.Google.Protobuf.Any_Fields + Proto.Google.Protobuf.Api + Proto.Google.Protobuf.Api_Fields Proto.Google.Protobuf.Compiler.Plugin Proto.Google.Protobuf.Compiler.Plugin_Fields Proto.Google.Protobuf.Descriptor @@ -53,15 +59,23 @@ library Proto.Google.Protobuf.Duration_Fields Proto.Google.Protobuf.Empty Proto.Google.Protobuf.Empty_Fields - Proto.Google.Protobuf.Wrappers - Proto.Google.Protobuf.Wrappers_Fields + Proto.Google.Protobuf.FieldMask + Proto.Google.Protobuf.FieldMask_Fields + Proto.Google.Protobuf.SourceContext + Proto.Google.Protobuf.SourceContext_Fields Proto.Google.Protobuf.Struct Proto.Google.Protobuf.Struct_Fields Proto.Google.Protobuf.Timestamp Proto.Google.Protobuf.Timestamp_Fields + Proto.Google.Protobuf.Type + Proto.Google.Protobuf.Type_Fields + Proto.Google.Protobuf.Wrappers + Proto.Google.Protobuf.Wrappers_Fields autogen-modules: Proto.Google.Protobuf.Any Proto.Google.Protobuf.Any_Fields + Proto.Google.Protobuf.Api + Proto.Google.Protobuf.Api_Fields Proto.Google.Protobuf.Compiler.Plugin Proto.Google.Protobuf.Compiler.Plugin_Fields Proto.Google.Protobuf.Descriptor @@ -70,12 +84,18 @@ library Proto.Google.Protobuf.Duration_Fields Proto.Google.Protobuf.Empty Proto.Google.Protobuf.Empty_Fields - Proto.Google.Protobuf.Wrappers - Proto.Google.Protobuf.Wrappers_Fields + Proto.Google.Protobuf.FieldMask + Proto.Google.Protobuf.FieldMask_Fields + Proto.Google.Protobuf.SourceContext + Proto.Google.Protobuf.SourceContext_Fields Proto.Google.Protobuf.Struct Proto.Google.Protobuf.Struct_Fields Proto.Google.Protobuf.Timestamp Proto.Google.Protobuf.Timestamp_Fields + Proto.Google.Protobuf.Type + Proto.Google.Protobuf.Type_Fields + Proto.Google.Protobuf.Wrappers + Proto.Google.Protobuf.Wrappers_Fields hs-source-dirs: src build-tool-depends: