proto-lens-setup

Cabal support for codegen with proto-lens.

https://github.com/google/proto-lens#readme

Version on this page:0.4.0.4
LTS Haskell 20.26:0.4.0.6
Stackage Nightly 2024-12-04:0.4.0.8
Latest on Hackage:0.4.0.8

See all snapshots proto-lens-setup appears in

BSD-3-Clause licensed by Judah Jacobson
Maintained by [email protected]
This version can be pinned in stack with:proto-lens-setup-0.4.0.4@sha256:c44d1b6d68a8faf1d2f9c7ca492ce3c9c2ee66d255452c683f762f10c9ebe430,3185

Module documentation for 0.4.0.4

This package provides Cabal support for the proto-lens package. It automatically generates Haskell source files from protocol buffer files (.proto).

To generate Haskell modules for a Cabal package, import Data.ProtoLens.Setup from the Setup.hs file. For example:

import Data.ProtoLens.Setup
-- Here, "src" is the directory where .proto source files may be found
main = defaultMainGeneratingProtos "src"

Then, edit the .cabal file of your project to:

  • Specify build-type: Custom, and add a custom-setup clause that depends on proto-lens-setup.

  • List the .proto files in extra-source-files. Note that the field belongs at the top level of the .cabal file, rather than once per library/executable/etc.

  • List the generated modules (e.g. Proto.Foo.Bar) in exposed-modules or other-modules of the rule(s) that use them (e.g. the library or executables). Additionally, add proto-lens-runtime to the build-depends of those rules.

For example, in foo-bar-proto.cabal:

build-type: Custom
extra-source-files: src/foo/bar.proto
...
custom-setup
  setup-depends: base, Cabal, proto-lens-setup
library
    exposed-modules: Proto.Foo.Bar, Proto.Foo.Bar_Fields
    autogen-modules: Proto.Foo.Bar, Proto.Foo.Bar_Fields
    build-depends: proto-lens-runtime, ...

Changes

Changelog for proto-lens-setup

v0.4.0.4

  • Bump upper bound to allow base-4.14.
  • Bump upper bound to allow Cabal-3.2.

v0.4.0.3

  • Bump lower bounds to base-4.10 (ghc-8.2) and Cabal-2.0.
  • Support dependencies on base-4.13 (ghc-8.8) and Cabal-3.0.
  • Bump upper bounds to proto-lens-0.6.

v0.4.0.2

  • Bump upper bounds to support proto-lens-0.5.*.

v0.4.0.1

  • Bump the lower bound on base and containers to support ghc-8.6.1.
  • Support Cabal-2.4.*.

v0.4.0.0

  • Split out from proto-lens-protoc.

Older

See Changelog.md for proto-lens-protoc.