This commit is contained in:
Edouard Oger 2020-04-08 15:26:45 -04:00
Родитель 1f03a1d3e5
Коммит 50e7244232
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: A2F740742307674A
11 изменённых файлов: 88 добавлений и 128 удалений

19
Cargo.lock сгенерированный
Просмотреть файл

@ -1793,6 +1793,17 @@ dependencies = [
"prost",
]
[[package]]
name = "protobuf-gen"
version = "0.1.0"
dependencies = [
"clap",
"prost-build",
"serde",
"serde_derive",
"toml",
]
[[package]]
name = "push"
version = "0.1.0"
@ -2218,18 +2229,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "serde"
version = "1.0.105"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff"
checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.105"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8"
checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
dependencies = [
"proc-macro2",
"quote",

Просмотреть файл

@ -32,6 +32,7 @@ members = [
"megazords/ios/rust",
"megazords/lockbox",
"testing/sync-test",
"tools/protobuf-gen",
]
[profile.release]

Просмотреть файл

@ -456,7 +456,6 @@ The following text applies to code linked from these dependencies:
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[fixedbitset](https://github.com/bluss/fixedbitset),
[fnv](https://github.com/servo/rust-fnv),
[foreign-types-shared](https://github.com/sfackler/foreign-types),
[foreign-types](https://github.com/sfackler/foreign-types),
@ -468,7 +467,6 @@ The following text applies to code linked from these dependencies:
[futures-util](https://github.com/rust-lang/futures-rs),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[heck](https://github.com/withoutboats/heck),
[hex](https://github.com/KokaKiwi/rust-hex),
[http](https://github.com/hyperium/http),
[httparse](https://github.com/seanmonstar/httparse),
@ -488,7 +486,6 @@ The following text applies to code linked from these dependencies:
[lru-cache](https://github.com/contain-rs/lru-cache),
[mime](https://github.com/hyperium/mime),
[miow](https://github.com/alexcrichton/miow),
[multimap](https://github.com/havarnov/multimap),
[native-tls](https://github.com/sfackler/rust-native-tls),
[net2](https://github.com/rust-lang-nursery/net2-rs),
[num_cpus](https://github.com/seanmonstar/num_cpus),
@ -498,7 +495,6 @@ The following text applies to code linked from these dependencies:
[openssl](https://github.com/sfackler/rust-openssl),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[petgraph](https://github.com/petgraph/petgraph),
[pin-project-internal](https://github.com/taiki-e/pin-project),
[pin-project-lite](https://github.com/taiki-e/pin-project-lite),
[pin-project](https://github.com/taiki-e/pin-project),
@ -506,9 +502,7 @@ The following text applies to code linked from these dependencies:
[pkg-config](https://github.com/rust-lang/pkg-config-rs),
[ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion),
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-build](https://github.com/danburkert/prost),
[prost-derive](https://github.com/danburkert/prost),
[prost-types](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
@ -540,7 +534,6 @@ The following text applies to code linked from these dependencies:
[unicase](https://github.com/seanmonstar/unicase),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),

Просмотреть файл

@ -417,7 +417,6 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
The following text applies to code linked from these dependencies:
[anyhow](https://github.com/dtolnay/anyhow),
[autocfg](https://github.com/cuviper/autocfg),
[backtrace-sys](https://github.com/alexcrichton/backtrace-rs),
[backtrace](https://github.com/rust-lang/backtrace-rs),
[base64](https://github.com/alicemaz/rust-base64),
@ -435,14 +434,11 @@ The following text applies to code linked from these dependencies:
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[fixedbitset](https://github.com/bluss/fixedbitset),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[heck](https://github.com/withoutboats/heck),
[hex](https://github.com/KokaKiwi/rust-hex),
[humantime](https://github.com/tailhook/humantime),
[idna](https://github.com/servo/rust-url/),
[indexmap](https://github.com/bluss/indexmap),
[itertools](https://github.com/bluss/rust-itertools),
[itoa](https://github.com/dtolnay/itoa),
[jna](https://github.com/java-native-access/jna),
@ -452,17 +448,13 @@ The following text applies to code linked from these dependencies:
[linked-hash-map](https://github.com/contain-rs/linked-hash-map),
[log](https://github.com/rust-lang/log),
[lru-cache](https://github.com/contain-rs/lru-cache),
[multimap](https://github.com/havarnov/multimap),
[once_cell](https://github.com/matklad/once_cell),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[petgraph](https://github.com/petgraph/petgraph),
[pkg-config](https://github.com/rust-lang/pkg-config-rs),
[ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion),
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-build](https://github.com/danburkert/prost),
[prost-derive](https://github.com/danburkert/prost),
[prost-types](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
@ -471,7 +463,6 @@ The following text applies to code linked from these dependencies:
[rand_core](https://github.com/rust-random/rand),
[regex-syntax](https://github.com/rust-lang/regex),
[regex](https://github.com/rust-lang/regex),
[remove_dir_all](https://github.com/XAMPPRocky/remove_dir_all.git),
[rustc-demangle](https://github.com/alexcrichton/rustc-demangle),
[rustc-hash](https://github.com/rust-lang-nursery/rustc-hash),
[ryu](https://github.com/dtolnay/ryu),
@ -482,13 +473,11 @@ The following text applies to code linked from these dependencies:
[smallbitvec](https://github.com/servo/smallbitvec),
[smallvec](https://github.com/servo/rust-smallvec),
[syn](https://github.com/dtolnay/syn),
[tempfile](https://github.com/Stebalien/tempfile),
[thread_local](https://github.com/Amanieu/thread_local-rs),
[time](https://github.com/rust-lang/time),
[toml](https://github.com/alexcrichton/toml-rs),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),

Просмотреть файл

@ -24,10 +24,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: anyhow</name>
<url>https://github.com/dtolnay/anyhow/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: autocfg</name>
<url>https://github.com/cuviper/autocfg/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: backtrace</name>
<url>https://github.com/rust-lang/backtrace-rs/blob/master/LICENSE-APACHE</url>
@ -100,10 +96,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: ffi-support</name>
<url>https://raw.githubusercontent.com/mozilla/application-services/master/components/support/ffi/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: fixedbitset</name>
<url>https://github.com/bluss/fixedbitset/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: getrandom</name>
<url>https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE</url>
@ -112,10 +104,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: glob</name>
<url>https://github.com/rust-lang/glob/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: heck</name>
<url>https://github.com/withoutboats/heck/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: hex</name>
<url>https://github.com/KokaKiwi/rust-hex/blob/master/LICENSE-APACHE</url>
@ -128,10 +116,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: idna</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: indexmap</name>
<url>https://github.com/bluss/indexmap/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: itertools</name>
<url>https://github.com/bluss/rust-itertools/blob/master/LICENSE-APACHE</url>
@ -168,10 +152,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: lru-cache</name>
<url>https://github.com/contain-rs/lru-cache/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: multimap</name>
<url>https://github.com/havarnov/multimap/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: once_cell</name>
<url>https://github.com/matklad/once_cell/blob/master/LICENSE-APACHE</url>
@ -184,10 +164,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: percent-encoding</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: petgraph</name>
<url>https://github.com/petgraph/petgraph/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: pkg-config</name>
<url>https://github.com/rust-lang/pkg-config-rs/blob/master/LICENSE-APACHE</url>
@ -204,18 +180,10 @@ the details of which are reproduced below.
<name>Apache License 2.0: prost</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: prost-build</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: prost-derive</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: prost-types</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: quick-error</name>
<url>https://github.com/tailhook/quick-error/blob/master/LICENSE-APACHE</url>
@ -244,10 +212,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: regex-syntax</name>
<url>https://github.com/rust-lang/regex/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: remove_dir_all</name>
<url>https://github.com/XAMPPRocky/remove_dir_all/blob/master/LICENCE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: rustc-demangle</name>
<url>https://github.com/alexcrichton/rustc-demangle/blob/master/LICENSE-APACHE</url>
@ -288,10 +252,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: syn</name>
<url>https://github.com/dtolnay/syn/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: tempfile</name>
<url>https://github.com/Stebalien/tempfile/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: thread_local</name>
<url>https://github.com/Amanieu/thread_local-rs/blob/master/LICENSE-APACHE</url>
@ -312,10 +272,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: unicode-normalization</name>
<url>https://github.com/unicode-rs/unicode-normalization/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-segmentation</name>
<url>https://github.com/unicode-rs/unicode-segmentation/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-width</name>
<url>https://github.com/unicode-rs/unicode-width/blob/master/LICENSE-APACHE</url>

Просмотреть файл

@ -448,7 +448,6 @@ The following text applies to code linked from these dependencies:
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[fixedbitset](https://github.com/bluss/fixedbitset),
[fnv](https://github.com/servo/rust-fnv),
[futures-channel](https://github.com/rust-lang/futures-rs),
[futures-core](https://github.com/rust-lang/futures-rs),
@ -458,7 +457,6 @@ The following text applies to code linked from these dependencies:
[futures-util](https://github.com/rust-lang/futures-rs),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[heck](https://github.com/withoutboats/heck),
[hex](https://github.com/KokaKiwi/rust-hex),
[http](https://github.com/hyperium/http),
[httparse](https://github.com/seanmonstar/httparse),
@ -476,14 +474,12 @@ The following text applies to code linked from these dependencies:
[log](https://github.com/rust-lang/log),
[lru-cache](https://github.com/contain-rs/lru-cache),
[mime](https://github.com/hyperium/mime),
[multimap](https://github.com/havarnov/multimap),
[native-tls](https://github.com/sfackler/rust-native-tls),
[net2](https://github.com/rust-lang-nursery/net2-rs),
[num_cpus](https://github.com/seanmonstar/num_cpus),
[once_cell](https://github.com/matklad/once_cell),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[petgraph](https://github.com/petgraph/petgraph),
[pin-project-internal](https://github.com/taiki-e/pin-project),
[pin-project-lite](https://github.com/taiki-e/pin-project-lite),
[pin-project](https://github.com/taiki-e/pin-project),
@ -491,9 +487,7 @@ The following text applies to code linked from these dependencies:
[pkg-config](https://github.com/rust-lang/pkg-config-rs),
[ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion),
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-build](https://github.com/danburkert/prost),
[prost-derive](https://github.com/danburkert/prost),
[prost-types](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
@ -525,7 +519,6 @@ The following text applies to code linked from these dependencies:
[unicase](https://github.com/seanmonstar/unicase),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),

Просмотреть файл

@ -415,7 +415,6 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
The following text applies to code linked from these dependencies:
[anyhow](https://github.com/dtolnay/anyhow),
[autocfg](https://github.com/cuviper/autocfg),
[backtrace-sys](https://github.com/alexcrichton/backtrace-rs),
[backtrace](https://github.com/rust-lang/backtrace-rs),
[base64](https://github.com/alicemaz/rust-base64),
@ -432,14 +431,11 @@ The following text applies to code linked from these dependencies:
[fallible-iterator](https://github.com/sfackler/rust-fallible-iterator),
[fallible-streaming-iterator](https://github.com/sfackler/fallible-streaming-iterator),
[ffi-support](https://github.com/mozilla/application-services),
[fixedbitset](https://github.com/bluss/fixedbitset),
[getrandom](https://github.com/rust-random/getrandom),
[glob](https://github.com/rust-lang/glob),
[heck](https://github.com/withoutboats/heck),
[hex](https://github.com/KokaKiwi/rust-hex),
[humantime](https://github.com/tailhook/humantime),
[idna](https://github.com/servo/rust-url/),
[indexmap](https://github.com/bluss/indexmap),
[itertools](https://github.com/bluss/rust-itertools),
[itoa](https://github.com/dtolnay/itoa),
[jna](https://github.com/java-native-access/jna),
@ -449,17 +445,13 @@ The following text applies to code linked from these dependencies:
[linked-hash-map](https://github.com/contain-rs/linked-hash-map),
[log](https://github.com/rust-lang/log),
[lru-cache](https://github.com/contain-rs/lru-cache),
[multimap](https://github.com/havarnov/multimap),
[once_cell](https://github.com/matklad/once_cell),
[peeking_take_while](https://github.com/fitzgen/peeking_take_while),
[percent-encoding](https://github.com/servo/rust-url/),
[petgraph](https://github.com/petgraph/petgraph),
[pkg-config](https://github.com/rust-lang/pkg-config-rs),
[ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion),
[proc-macro2](https://github.com/alexcrichton/proc-macro2),
[prost-build](https://github.com/danburkert/prost),
[prost-derive](https://github.com/danburkert/prost),
[prost-types](https://github.com/danburkert/prost),
[prost](https://github.com/danburkert/prost),
[quick-error](http://github.com/tailhook/quick-error),
[quote](https://github.com/dtolnay/quote),
@ -468,7 +460,6 @@ The following text applies to code linked from these dependencies:
[rand_core](https://github.com/rust-random/rand),
[regex-syntax](https://github.com/rust-lang/regex),
[regex](https://github.com/rust-lang/regex),
[remove_dir_all](https://github.com/XAMPPRocky/remove_dir_all.git),
[rustc-demangle](https://github.com/alexcrichton/rustc-demangle),
[rustc-hash](https://github.com/rust-lang-nursery/rustc-hash),
[ryu](https://github.com/dtolnay/ryu),
@ -478,13 +469,11 @@ The following text applies to code linked from these dependencies:
[shlex](https://github.com/comex/rust-shlex),
[smallvec](https://github.com/servo/rust-smallvec),
[syn](https://github.com/dtolnay/syn),
[tempfile](https://github.com/Stebalien/tempfile),
[thread_local](https://github.com/Amanieu/thread_local-rs),
[time](https://github.com/rust-lang/time),
[toml](https://github.com/alexcrichton/toml-rs),
[unicode-bidi](https://github.com/servo/unicode-bidi),
[unicode-normalization](https://github.com/unicode-rs/unicode-normalization),
[unicode-segmentation](https://github.com/unicode-rs/unicode-segmentation),
[unicode-width](https://github.com/unicode-rs/unicode-width),
[unicode-xid](https://github.com/unicode-rs/unicode-xid),
[url](https://github.com/servo/rust-url),

Просмотреть файл

@ -24,10 +24,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: anyhow</name>
<url>https://github.com/dtolnay/anyhow/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: autocfg</name>
<url>https://github.com/cuviper/autocfg/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: backtrace</name>
<url>https://github.com/rust-lang/backtrace-rs/blob/master/LICENSE-APACHE</url>
@ -96,10 +92,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: ffi-support</name>
<url>https://raw.githubusercontent.com/mozilla/application-services/master/components/support/ffi/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: fixedbitset</name>
<url>https://github.com/bluss/fixedbitset/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: getrandom</name>
<url>https://github.com/rust-random/getrandom/blob/master/LICENSE-APACHE</url>
@ -108,10 +100,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: glob</name>
<url>https://github.com/rust-lang/glob/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: heck</name>
<url>https://github.com/withoutboats/heck/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: hex</name>
<url>https://github.com/KokaKiwi/rust-hex/blob/master/LICENSE-APACHE</url>
@ -124,10 +112,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: idna</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: indexmap</name>
<url>https://github.com/bluss/indexmap/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: itertools</name>
<url>https://github.com/bluss/rust-itertools/blob/master/LICENSE-APACHE</url>
@ -164,10 +148,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: lru-cache</name>
<url>https://github.com/contain-rs/lru-cache/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: multimap</name>
<url>https://github.com/havarnov/multimap/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: once_cell</name>
<url>https://github.com/matklad/once_cell/blob/master/LICENSE-APACHE</url>
@ -180,10 +160,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: percent-encoding</name>
<url>https://github.com/servo/rust-url/blob//master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: petgraph</name>
<url>https://github.com/petgraph/petgraph/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: pkg-config</name>
<url>https://github.com/rust-lang/pkg-config-rs/blob/master/LICENSE-APACHE</url>
@ -200,18 +176,10 @@ the details of which are reproduced below.
<name>Apache License 2.0: prost</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: prost-build</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: prost-derive</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: prost-types</name>
<url>https://github.com/danburkert/prost/blob/master/LICENSE</url>
</license>
<license>
<name>Apache License 2.0: quick-error</name>
<url>https://github.com/tailhook/quick-error/blob/master/LICENSE-APACHE</url>
@ -240,10 +208,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: regex-syntax</name>
<url>https://github.com/rust-lang/regex/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: remove_dir_all</name>
<url>https://github.com/XAMPPRocky/remove_dir_all/blob/master/LICENCE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: rustc-demangle</name>
<url>https://github.com/alexcrichton/rustc-demangle/blob/master/LICENSE-APACHE</url>
@ -280,10 +244,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: syn</name>
<url>https://github.com/dtolnay/syn/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: tempfile</name>
<url>https://github.com/Stebalien/tempfile/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: thread_local</name>
<url>https://github.com/Amanieu/thread_local-rs/blob/master/LICENSE-APACHE</url>
@ -304,10 +264,6 @@ the details of which are reproduced below.
<name>Apache License 2.0: unicode-normalization</name>
<url>https://github.com/unicode-rs/unicode-normalization/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-segmentation</name>
<url>https://github.com/unicode-rs/unicode-segmentation/blob/master/LICENSE-APACHE</url>
</license>
<license>
<name>Apache License 2.0: unicode-width</name>
<url>https://github.com/unicode-rs/unicode-width/blob/master/LICENSE-APACHE</url>

Просмотреть файл

@ -0,0 +1,13 @@
[package]
name = "protobuf-gen"
version = "0.1.0"
authors = ["Edouard Oger <eoger@fastmail.com>"]
edition = "2018"
license = "MPL-2.0"
[dependencies]
clap = "2.33.0"
prost-build = "0.6.1"
serde = "1.0.106"
serde_derive = "1.0.106"
toml = "0.5.6"

Просмотреть файл

@ -0,0 +1,9 @@
# protobuf-gen
You may ask yourself: why not use `prost-build` directly in `build.rs` scripts like everybody else does?
Well, Reasons, as usual.
- `prost-build` includes big binaries (> 4MB for each architecture) that we would not be able to check into mozilla-central.
- `protoc` is not even a dependency to build `mozilla-central`, therefore we would not be able to check in a "lite" version of `prost-build` that doesn't contain those binaries.
So instead, we use `prost-build` separately and check-in the Rust artifacts it generates. And that also makes the build faster, whoo-hoo.

Просмотреть файл

@ -0,0 +1,50 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use clap::{App, Arg};
use serde_derive::Deserialize;
use std::{collections::HashMap, fs, path::PathBuf};
use toml;
#[derive(Deserialize, Debug)]
struct ProtobufOpts {
dir: String,
out_dir: Option<String>,
}
fn main() {
let matches = App::new("Protobuf files generator")
.about("Generates Rust structs from protobuf files in the repository.")
.arg(
Arg::with_name("PROTOBUF_CONFIG")
.help("Absolute path to the protobuf configuration file.")
.required(true),
)
.get_matches();
let config_path = matches.value_of("PROTOBUF_CONFIG").unwrap();
let config_path = PathBuf::from(config_path);
let files_config = fs::read_to_string(&config_path).expect("unable to read protobuf_files");
let files: HashMap<String, ProtobufOpts> = toml::from_str(&files_config).unwrap();
let config_dir = config_path.parent().unwrap();
for (proto_file, opts) in files {
// Can't re-use Config because the out_dir is always different.
let mut config = prost_build::Config::new();
let out_dir = opts.out_dir.clone().unwrap_or_else(|| opts.dir.clone());
let out_dir_absolute = config_dir.join(&out_dir).canonicalize().unwrap();
let out_dir_absolute = out_dir_absolute.to_str().unwrap();
let proto_path_absolute = config_dir
.join(&opts.dir)
.join(proto_file)
.canonicalize()
.unwrap();
let proto_path_absolute = proto_path_absolute.to_str().unwrap();
let include_dir_absolute = config_dir.join(&opts.dir).canonicalize().unwrap();
let include_dir_absolute = include_dir_absolute.to_str().unwrap();
config.out_dir(&out_dir_absolute);
config
.compile_protos(&[proto_path_absolute], &[&include_dir_absolute])
.unwrap();
}
}