Package0.4.0.9
proto-lens-setup
Cabal support for codegen with proto-lens.
- Version0.4.0.9
- LicenceBSD-3-Clause
- AuthorJudah Jacobson
- Maintainerproto-lens@googlegroups.com
- Homepagegithub.com/google/proto-lens#readme
- Pinned byhackage proto-lens-setup 0.4.0.9
- Sourcehackage.haskell.org/package/proto-lens-setup-0.4.0.9
Modules
1 module- Data.ProtoLens.Setup6Helper functions to generate proto files as part of a Setup.hs script. These functions assume that the proto-lens-protoc executable is on…
Description
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, ...
Depends on
11 packages- Cabal-3.12.1.0with GHC
- base-4.20.2.0with GHC
- bytestring-0.12.2.0with GHC
- containers-0.7with GHC
- deepseq-1.5.0.0with GHC
- directory-1.3.8.5with GHC
- filepath-1.5.4.0with GHC
- process-1.6.26.1with GHC
- proto-lens-protoc-0.9.0.0in this set
- temporary-1.3in this set
- text-2.1.3with GHC
Used by in this set · 0
Nothing in this set depends on it.