wgc router plugin build
Thebuild command generates gRPC code based on your GraphQL schema and compiles your plugin into platform-specific binaries.
Usage
Arguments
Options
Description
This command performs several steps to build your plugin:- Generate Proto and Mapping Files: Processes your GraphQL schema to generate Protocol Buffers definitions and mapping files
- Generate gRPC Code: Uses the generated Proto files to create Go code for the gRPC service
- Install Go Dependencies: Installs all required Go dependencies for your plugin
- Build Binaries: Compiles the plugin for one or more platform-architecture combinations
--generate-only flag.
Required Tools
The build command will automatically check for and install the necessary toolchain (like protoc, protoc-gen-go, etc.) when required tools can’t be found in the right version on your system. You can control this behavior with the--skip-tools-installation and --force-tools-installation flags.
For debugging your plugin, use the --debug flag to build with debug symbols. This enables debugging with tools like Delve, GoLand, or VS Code. See the debugging guide for detailed instructions.
You can also install the dependencies manually and use an IDE with Go support. The following table shows the current versions and download links for the required tools:
Examples
Build for the current platform
Generate code only
Build for multiple platforms
Build for all supported platforms
Supported Platforms
The following platform-architecture combinations are supported:
When using the
--all-platforms flag, binaries for all of the above platforms will be built.
Output
The build process creates several outputs:- Generated Go code in the
generated/directory - Compiled binaries in the
bin/directory, named according to the target platform (e.g.,my-plugin-darwin-arm64,my-plugin-linux-amd64)