proto-lens-protoc-0.1.0.2: Protocol buffer compiler for the proto-lens library.

Safe HaskellNone
LanguageHaskell2010

Data.ProtoLens.Setup

Description

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.

Synopsis

Documentation

defaultMainGeneratingProtos Source #

Arguments

:: FilePath

The root directory under which .proto files can be found.

-> IO () 

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.

generatingProtos Source #

Arguments

:: FilePath

The root directory under which .proto files can be found.

-> UserHooks 
-> UserHooks 

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.

generateProtos Source #

Arguments

:: 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.