Skip to content

Commit

Permalink
Move rust sources into the repo's root (#76)
Browse files Browse the repository at this point in the history
Currently, the core project is a cargo workspace with a single package
in the `rs/` directory containing the package's Cargo.toml and sources.
This prevents the crate from being published to crates.io, since the
`protos` dir is not part of the package directory.

To fix this, this change moves the contents of the `rs/` directory to
the root of repo, replacing the cargo worksapce with a single cargo
package.
  • Loading branch information
olix0r authored Jul 16, 2021
1 parent 4043212 commit e6dec3f
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 48 deletions.
46 changes: 42 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
[workspace]
members = [
"rs"
]
[package]
name = "linkerd2-proxy-api"
version = "0.2.0"
authors = ["Linkerd Developers <cncf-linkerd-dev@lists.cncf.io>"]
license = "Apache-2.0"
edition = "2018"

[features]
default = []

# Generate code that is compatible with Tonic's `transport` module.
transport = ["tonic-build/transport", "tonic/transport"]

# Generate code that is formatted.
rustfmt = ["tonic-build/rustfmt"]

# Enable generation of arbitrary protos with quickcheck.
arbitrary = ["quickcheck"]

# Determines whether clients or servers are built
client = ["transport"]
server = ["transport"]

destination = ["http_types", "net", "prost-types"]
http_types = ["http", "thiserror"]
identity = ["prost-types"]
inbound = ["net", "prost-types"]
net = ["ipnet", "thiserror"]
tap = ["h2", "http_types", "net", "prost-types"]

[dependencies]
h2 = { version = "0.3", optional = true }
http = { version = "0.2", optional = true }
ipnet = { version = "2", optional = true }
prost = "0.8"
prost-types = { version = "0.8", optional = true }
quickcheck = { version = "1", default-features = false, optional = true }
thiserror = { version = "1", optional = true }
tonic = { version = "0.5", default-features = false, features = ["prost", "codegen"] }

[build-dependencies]
tonic-build = { version = "0.5", default-features = false, features = ["prost"] }
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $(PROTOC):
rm $(PROTOC).zip
chmod 755 $(PROTOC)

Cargo.lock: Cargo.toml rs/Cargo.toml
Cargo.lock: Cargo.toml
$(CARGO) fetch

.PHONY: rs
Expand Down
2 changes: 1 addition & 1 deletion rs/build.rs → build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::error::Error;

const DIR: &str = "../proto";
const DIR: &str = "proto";
const PROTOS: [&str; 6] = [
"destination",
"http_types",
Expand Down
42 changes: 0 additions & 42 deletions rs/Cargo.toml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e6dec3f

Please sign in to comment.