forked from containerd/protobuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProtobuild.toml
138 lines (116 loc) · 5.25 KB
/
Protobuild.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
version = "unstable"
# Generator defines which generator to go. The default is "go". This will be
# formatted into the --xxx_out flag provided to protoc. Below, we have an
# example that selects the ctrd vanity binary.
# generator = "gogoctrd"
[[generator]]
name = "gotemplate"
[generator.options]
debug = true
template_dir = "."
[[generator]]
name = "gogo"
[[plugin]]
name = "grpc"
[plugin.options]
debug = true
[[plugin]]
name = "govalidator"
# plugins = ["grpc"]
# Control protoc include paths. Below are usually some good defaults, but feel
# free to try it without them if it works for your project.
[includes]
# Include paths that will be added before all others. Typically, you want to
# treat the root of the project as an include, but this may not be necessary.
#
# "." is included by default
# before = ["."]
# Paths that should be treated as include roots in relation to the vendor
# directory. These will be calculated with the vendor directory nearest the
# target package.
#
# This should be used only in cases where imports must be resolved from the
# vendor package and not a GOPATH package. Most users should employ the
# `packages` configuration and let protobuild resolve the existing package.
#
# With the example below, we import the gogo protobufs from the vendor
# directory.
#
# This is empty by default.
# vendored = ["github.com/gogo/protobuf"]
# Packages will add imports that are relative to the vendor path or GOPATH.
# For example, if we import `gogoproto/gogo.proto`, we would add an import
# root of `$GOPATH/github.com/gogo/protobuf`, in addition to the vendored
# directory.
#
# If in doubt, use this over `vendored` configuration for your project.
#
# This is empty by default.
# packages = ["github.com/gogo/protobuf"]
# Paths that will be added untouched to the end of the includes. We use
# `/usr/local/include` to pickup the common install location of protobuf.
# This is the default.
# after = ["usr/local/include"]
# This section let's us map protobuf imports to Go packages. These will become
# `-M` directives in the call to the go protobuf generator.
#
# We have a few examples to map packages from the examples.
[packages]
"gogoproto/gogo.proto" = "github.com/gogo/protobuf/gogoproto"
"google/protobuf/descriptor.proto" = "github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"google/protobuf/timestamp.proto" = "github.com/gogo/protobuf/types"
"google/protobuf/empty.proto" = "github.com/gogo/protobuf/types"
# Overrides allows one to specify configuration overrides for specific
# packages. Currently, only overriding the generator and plugin set are
# supported.
#
# This can be used to use a different plugin set for a given package.
[[overrides]]
# Prefix specifies the protobuf import path to which the configuration
# overrides apply.
#
# This works the same as the descriptors selection prefix except that each path
# that is overridden must be specified, rather than applying to the whole tree.
#
# For this example, if there were a package that needed this overrides applied,
# you would need to specify that explicitly in the prefixes list. This allows
# one to granularly select which packages have the overrides.
prefixes = ["github.com/stevvooe/protobuild/examples/nogrpc"]
# Generator allows one to override the generator for the given prefix.
# generator = ""
# Plugins will override the entire plugin set for the specified prefix.
plugins = []
# Descriptors allows you to aggregate generated protobuf descriptors under a
# particular Go import path into a single, de-duplicated file. The result of
# configuring this option for one or more paths will be a text format protobuf
# dump of all the descriptors in the API.
#
# While this is useful for other applications that require access to
# descriptors, the goal of this features is to provide visibility into changes
# that may affect API stability. Each service, message and field will be
# included in the file, along with dependencies. If a change occurs that
# impacts API stability, it will be obvious in a diff with a file from the
# previous version.
#
# Save these descriptors in your repository. When the next round of protobuf
# changes are built and merged, additions and incompatible changes can be
# detected by diffing these files. When you release, move this file to the
# release version to keep track of the exports over time from various releases.
#
# This takes inspiration from Go's API checker in
# https://github.com/golang/go/tree/master/api, but does so for protobufs.
# Stablize packages and collections of packages of generated protobufs.
[[descriptors]]
# Prefix specifies the protobuf import prefix relative to items that you want
# to stabilize.
#
# For example, if the files are imported as
# github.com/stevvooe/protobuild/examples/foo/foo.proto, and you want to
# stabilize everything in package "foo", it should be
# "github.com/stevvooe/protobuild/example/foo".
#
# The example below stablizes the protobufs under the examples directory. The
# generated descriptor file will include both the "foo" and "bar" subpackages.
prefix = "github.com/stevvooe/protobuild/examples"
# Target defines the output location of the merged descriptor file.
target = "examples/next.pb.txt"