Safe Haskell | None |
---|---|
Language | Haskell2010 |
Helper functions to generate proto files as part of a Setup.hs
script.
These functions assume that the proto-lens-protoc
executable is on the
PATH, and throw an exception otherwise. That executable will be installed
automatically as part of installing this package; in particular, it should
be enough to just list `proto-lens-protoc` in a user package's
`build-dependencies`.
See README.md
for instructions on how to use proto-lens with Cabal.
- defaultMainGeneratingProtos :: FilePath -> IO ()
- generatingProtos :: FilePath -> UserHooks -> UserHooks
- generateProtos :: FilePath -> FilePath -> [FilePath] -> IO ()
Documentation
defaultMainGeneratingProtos Source #
This behaves the same as defaultMain
, but
auto-generates Haskell files from the .proto files listed in
the .cabal
file under extra-source-files
which are located under the
given root directory.
Writes the generated files to the autogen directory (dist/build/autogen
for Cabal, and .stack-work/dist/.../build/autogen
for stack).
Throws an exception if the proto-lens-protoc
executable is not on the PATH.
Augment the given UserHooks
to auto-generate Haskell files from the
.proto files listed in the .cabal
file under extra-source-files
which
are located under the given root directory.
Writes the generated files to the autogen directory (dist/build/autogen
for Cabal, and .stack-work/dist/.../build/autogen
for stack).
Throws an exception if the proto-lens-protoc
executable is not on the PATH.
:: FilePath | The root directory under which .proto files can be found. |
-> FilePath | The output directory for the generated Haskell files. |
-> [FilePath] | The .proto files to process. |
-> IO () |
Run the proto compiler to generate Haskell files from the given .proto files.
Writes the generated files to the autogen directory (dist/build/autogen
for Cabal, and .stack-work/dist/.../build/autogen
for stack).
Throws an exception if the proto-lens-protoc
executable is not on the PATH.