1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mirrors-exonum

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
README.md 2.1 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Oleksandr Anyshchenko Отправлено 19.07.2020 08:11 e0fdc05

Build scripts utility for Exonum

Travis Build Status License: Apache-2.0 rust 1.45.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.

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mirrors-exonum.git
git@api.gitlife.ru:oschina-mirror/mirrors-exonum.git
oschina-mirror
mirrors-exonum
mirrors-exonum
master