Crates.io | volo-build |
lib.rs | volo-build |
version | |
source | src |
created_at | 2022-08-23 07:19:52.659603 |
updated_at | 2024-11-06 13:46:05.572249 |
description | Compile thrift and protobuf idls into rust code at compile-time. |
homepage | https://www.cloudwego.io/docs/volo/ |
repository | https://github.com/cloudwego/volo |
max_upload_size | |
id | 650814 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
volo-build compiles thrift and protobuf idl files into rust code at compile-time.
Usually, if you are using volo-cli
to generate the code, you don't need to use volo-build
directly.
If you want to use volo-build
directly, you can follow the following steps:
First, add volo-build
to your Cargo.toml
:
[build-dependencies]
volo-build = "*" # make sure you use a compatible version with `volo`
Second, creates a build.rs
file:
fn main() {
volo_build::Builder::default().write().unwrap();
}
Third, creates a volo.yml
file in the same directory of build.rs
with the following layout:
---
idls:
- source: local
path: path/to/your/idl.thrift
- source: local
path: path/to/your/protobuf/idl.proto
includes:
- path/to/your/protobuf/
- source: git
repo: git@github.com:cloudwego/volo.git
ref: main
path: path/in/repo/idl.thrift
That's it!