10 releases (2 stable)

1.0.1 Apr 14, 2020
1.0.0 Mar 31, 2020
1.0.0-rc.1 Feb 7, 2020
0.13.0-rc.2 Dec 4, 2019
0.10.0 Dec 14, 2018

#8 in Cryptocurrencies

Download history 264/week @ 2020-05-26 480/week @ 2020-06-02 222/week @ 2020-06-09 410/week @ 2020-06-16 503/week @ 2020-06-23 481/week @ 2020-06-30 337/week @ 2020-07-07 341/week @ 2020-07-14 280/week @ 2020-07-21 372/week @ 2020-07-28 223/week @ 2020-08-04 339/week @ 2020-08-11 335/week @ 2020-08-18 360/week @ 2020-08-25 443/week @ 2020-09-01 246/week @ 2020-09-08

1,365 downloads per month
Used in 20 crates (12 directly)

Apache-2.0

19KB
266 lines

Build scripts utility for Exonum

Travis Build Status License: Apache-2.0 rust 1.42.0+ required

This crate simplifies writing build scripts for Exonum and Exonum services.

Since Protobuf is the Exonum default serialization format, build scripts are mostly used to compile Protobuf files and generate corresponding code. Generated code is used later by the Exonum core and services.

There are several predefined sets of protobuf sources available for use. Currently presented sets:

  • Crypto sources: all the necessary crypto types used in services and system proto-files. These types are Hash, PublicKey and Signature.
  • Exonum sources: types used in core and in system services such as the supervisor.
  • Common sources: types that can be used by various parts of Exonum.
  • MerkleDB sources: types representing proofs of existence of element in database.

Consult the crate docs for more details.

Examples

Sample build.rs using exonum-build:

use exonum_build::ProtobufGenerator;

fn main() {
    ProtobufGenerator::with_mod_name("protobuf_mod.rs")
        .with_input_dir("src/proto")
        .with_crypto()
        .generate();
}

Usage

Include exonum-build as a dependency in your Cargo.toml:

[build-dependencies]
exonum-build = "1.0.0"

Known Issues

The code generator used by the crate does not support hierarchies, instead using a flat structure for the generated Rust modules. This means that compile errors can occur if the generator input (accounting for includes!) contains several Protobuf files with the same base name (e.g., foo/bar.proto and other/bar.proto).

License

exonum-build is licensed under the Apache License (Version 2.0). See LICENSE for details.

Dependencies

~3MB
~63K SLoC