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