Create a `lib` dir for subcrates (#97)

As we extract subcrates from the `src/` directory, the repository root
becomes a bit cluttered. This change moves these subcrates into a `lib`
directory.
This commit is contained in:
Oliver Gould 2018-09-18 16:02:31 -07:00 committed by GitHub
parent 53a85f442a
commit a4d4110776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 17 additions and 19 deletions

View File

@ -1,10 +1,10 @@
[workspace] [workspace]
members = [ members = [
".", ".",
"futures-mpsc-lossy", "lib/futures-mpsc-lossy",
"metrics", "lib/metrics",
"router", "lib/router",
"timeout", "lib/timeout",
] ]
[package] [package]
@ -19,10 +19,10 @@ default = ["flaky_tests"]
flaky_tests = [] flaky_tests = []
[dependencies] [dependencies]
futures-mpsc-lossy = { path = "./futures-mpsc-lossy" } futures-mpsc-lossy = { path = "lib/futures-mpsc-lossy" }
linkerd2-metrics = { path = "./metrics" } linkerd2-metrics = { path = "lib/metrics" }
linkerd2-proxy-router = { path = "./router" } linkerd2-proxy-router = { path = "lib/router" }
linkerd2-timeout = { path = "./timeout" } linkerd2-timeout = { path = "lib/timeout" }
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", tag = "v0.1.1", version = "0.1.1" } linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", tag = "v0.1.1", version = "0.1.1" }
@ -80,7 +80,7 @@ procinfo = "0.4.2"
[dev-dependencies] [dev-dependencies]
net2 = "0.2" net2 = "0.2"
quickcheck = { version = "0.6", default-features = false } quickcheck = { version = "0.6", default-features = false }
linkerd2-metrics = { path = "./metrics", features = ["test_util"] } linkerd2-metrics = { path = "./lib/metrics", features = ["test_util"] }
linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", tag = "v0.1.1", version = "0.1.1", features = ["arbitrary"] } linkerd2-proxy-api = { git = "https://github.com/linkerd/linkerd2-proxy-api", tag = "v0.1.1", version = "0.1.1", features = ["arbitrary"] }
flate2 = { version = "1.0.1", default-features = false, features = ["rust_backend"] } flate2 = { version = "1.0.1", default-features = false, features = ["rust_backend"] }
# `tokio-io` is needed for TCP tests, because `tokio::io` doesn't re-export # `tokio-io` is needed for TCP tests, because `tokio::io` doesn't re-export

View File

@ -19,21 +19,18 @@ WORKDIR /usr/src/linkerd2-proxy
# #
# Mock out all local code and fetch external dependencies to ensure that # Mock out all local code and fetch external dependencies to ensure that
# external sources are primarily cached on Cargo.lock. # external sources are primarily cached on Cargo.lock.
RUN for d in . futures-mpsc-lossy router metrics timeout ; \ RUN for d in . lib/futures-mpsc-lossy lib/router lib/metrics lib/timeout ; \
do mkdir -p "${d}/src" && touch "${d}/src/lib.rs" ; \ do mkdir -p "${d}/src" && touch "${d}/src/lib.rs" ; \
done done
COPY Cargo.toml Cargo.lock ./ COPY Cargo.toml Cargo.lock ./
COPY futures-mpsc-lossy/Cargo.toml futures-mpsc-lossy/Cargo.toml COPY lib/futures-mpsc-lossy/Cargo.toml lib/futures-mpsc-lossy/Cargo.toml
COPY metrics/Cargo.toml metrics/Cargo.toml COPY lib/metrics/Cargo.toml lib/metrics/Cargo.toml
COPY router/Cargo.toml router/Cargo.toml COPY lib/router/Cargo.toml lib/router/Cargo.toml
COPY timeout/Cargo.toml timeout/Cargo.toml COPY lib/timeout/Cargo.toml lib/timeout/Cargo.toml
RUN cargo fetch --locked RUN cargo fetch --locked
# Build libraries, leaving the proxy mocked out. # Build libraries, leaving the proxy mocked out.
COPY futures-mpsc-lossy futures-mpsc-lossy COPY lib lib
COPY router router
COPY metrics metrics
COPY timeout timeout
ARG PROXY_UNOPTIMIZED ARG PROXY_UNOPTIMIZED
RUN if [ -n "$PROXY_UNOPTIMIZED" ]; \ RUN if [ -n "$PROXY_UNOPTIMIZED" ]; \
then cargo build --frozen ; \ then cargo build --frozen ; \

View File

@ -2,6 +2,7 @@
name = "linkerd2-timeout" name = "linkerd2-timeout"
version = "0.1.0" version = "0.1.0"
authors = ["Oliver Gould <ver@buoyant.io>"] authors = ["Oliver Gould <ver@buoyant.io>"]
publish = false
[dependencies] [dependencies]
futures = "0.1" futures = "0.1"