Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deps ¶
Deps reads a protocol-buffer file and returns its list of dependencies. Included in the dependencies is the file itself, plus any files it imports (directly or indirectly) that can be found among the given include directories. The list is sorted for consistent, predictable results.
func Proto ¶
func Proto(inputs, outputs, includes, otherOpts []string, filesOpts ...fab.FilesOpt) (fab.Target, error)
Proto produces a target that compiles protocol-buffer files using the "protoc" command. Inputs is a list of .proto input files; outputs is a list of the expected output files; includes is a list of directories in which to find .proto files; otherOpts are options (other than -I / --proto_path options) for the protoc command line; and filesOpts are passed through to fab.Files (which this target is implemented in terms of).
Typically otherOpts includes at least "--foo_out=DIR" for some target language foo. This function uses Deps to find the dependencies of the input files.
A Proto target may be specified in YAML using the !proto.Proto tag, which introduces a mapping whose fields are:
- Inputs: the list of .proto input files
- Outputs: the list of expected output files
- Includes: the list of include directories
- Opts: the list of "other options" (see above) to pass to the protoc command line
- Autoclean: a boolean indicating whether the files listed in Outputs should be added to the "autoclean registry." See fab.Autoclean for more about this feature.
Types ¶
This section is empty.