proto-lens-setup: Cabal support for codegen with proto-lens.
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 acustom-setupclause that depends onproto-lens-setup.List the .proto files in
extra-source-files. Note that the field belongs at the top level of the.cabalfile, rather than once per library/executable/etc.List the generated modules (e.g.
Proto.Foo.Bar) inexposed-modulesorother-modulesof the rule(s) that use them (e.g. the library or executables). Additionally, addproto-lens-runtimeto thebuild-dependsof 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, ...
Downloads
- proto-lens-setup-0.4.0.9.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.4.0.0, 0.4.0.1, 0.4.0.2, 0.4.0.3, 0.4.0.4, 0.4.0.5, 0.4.0.6, 0.4.0.7, 0.4.0.8, 0.4.0.9 |
|---|---|
| Change log | Changelog.md |
| Dependencies | base (>=4.10 && <4.21), bytestring (>=0.10 && <0.13), Cabal (>=2.0 && <3.13), containers (>=0.5 && <0.8), deepseq (>=1.4 && <1.6), directory (>=1.2 && <1.4), filepath (>=1.4 && <1.6), process (>=1.2 && <1.7), proto-lens-protoc (>=0.4 && <0.10), temporary (>=1.2 && <1.4), text (>=1.2 && <2.2) [details] |
| License | BSD-3-Clause |
| Copyright | Google Inc. |
| Author | Judah Jacobson |
| Maintainer | proto-lens@googlegroups.com |
| Uploaded | by gnezdo at 2025-01-28T04:43:21Z |
| Revised | Revision 2 made by gnezdo at 2026-03-30T15:58:00Z |
| Home page | https://github.com/google/proto-lens#readme |
| Bug tracker | https://github.com/google/proto-lens/issues |
| Source repo | head: git clone https://github.com/google/proto-lens(proto-lens-setup) |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Downloads | 4813 total (33 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2025-01-28 [all 1 reports] |