diff --git a/Cargo.toml b/Cargo.toml index 160e461f2..a5459a700 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,42 @@ -[workspace] -members = [ - "rs" -] +[package] +name = "linkerd2-proxy-api" +version = "0.2.0" +authors = ["Linkerd Developers "] +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"] } diff --git a/Makefile b/Makefile index 62afeacf4..abcedee06 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/rs/build.rs b/build.rs similarity index 97% rename from rs/build.rs rename to build.rs index 0b026c463..73315d45e 100644 --- a/rs/build.rs +++ b/build.rs @@ -1,6 +1,6 @@ use std::error::Error; -const DIR: &str = "../proto"; +const DIR: &str = "proto"; const PROTOS: [&str; 6] = [ "destination", "http_types", diff --git a/rs/Cargo.toml b/rs/Cargo.toml deleted file mode 100644 index a5459a700..000000000 --- a/rs/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "linkerd2-proxy-api" -version = "0.2.0" -authors = ["Linkerd Developers "] -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"] } diff --git a/rs/src/gen/http_types.rs b/src/gen/http_types.rs similarity index 100% rename from rs/src/gen/http_types.rs rename to src/gen/http_types.rs diff --git a/rs/src/gen/mod.rs b/src/gen/mod.rs similarity index 100% rename from rs/src/gen/mod.rs rename to src/gen/mod.rs diff --git a/rs/src/gen/net.rs b/src/gen/net.rs similarity index 100% rename from rs/src/gen/net.rs rename to src/gen/net.rs diff --git a/rs/src/gen/tap.rs b/src/gen/tap.rs similarity index 100% rename from rs/src/gen/tap.rs rename to src/gen/tap.rs diff --git a/rs/src/lib.rs b/src/lib.rs similarity index 100% rename from rs/src/lib.rs rename to src/lib.rs