Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Generate Rust files from protobuf files on each build
Browse files Browse the repository at this point in the history
By generating sticker-tf-proto on the fly, we avoid being stuck to one
particular version of the protobuf dependency. The downside is that we
require `protoc` to be available.
  • Loading branch information
danieldk committed Oct 18, 2019
1 parent 4316407 commit f64a16a
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 21,070 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*~

target/
sticker-tf-proto/src/*.rs

.eggs
__pycache__
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
dist: xenial
dist: bionic
env:
global:
- PROJECT_NAME: sticker
addons:
apt:
packages:
- patchelf
- protobuf-compiler
homebrew:
packages:
- protobuf
matrix:
fast_finish: true
include:
Expand Down
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions sticker-tf-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ repository = "https://github.com/danieldk/sticker.git"
license = "Apache-2.0"

[dependencies]
# This is annoying, but the generated protobuf contains
# the version number in symbols and compilation fails when
# this dependency is updated
protobuf = "= 2.8.0"
protobuf = "2"

[build-dependencies]
protoc-rust = { version = "2", optional = true }

[features]
proto-compile = [ "protoc-rust" ]
protoc-rust = "2"
1 change: 0 additions & 1 deletion sticker-tf-proto/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
fn main() {
#[cfg(feature = "proto-compile")]
protoc_rust::run(protoc_rust::Args {
out_dir: "src",
input: &[
Expand Down
Loading

0 comments on commit f64a16a

Please sign in to comment.