Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved related cargo_manifest_dir examples into the same directory #473

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
docs
examples
examples/hello_cargo_manifest_dir
examples/cargo_manifest_dir/external_crate
2 changes: 1 addition & 1 deletion examples/.bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hello_cargo_manifest_dir
cargo_manifest_dir/external_crate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")

rust_library(
name = "hello_cargo_manifest_dir",
name = "external_crate",
srcs = ["src/lib.rs"],
data = ["include/included_file.rs.inc"],
visibility = ["//visibility:public"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
workspace(name = "rules_rust_example_cargo_manifest_dir")

local_repository(
name = "io_bazel_rules_rust",
path = "../..",
path = "../../../",
)

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_test")

rust_test(
name = "hello_uses_cargo_manifest_dir",
name = "cargo_manifest_dir_usage",
srcs = ["src/lib.rs"],
edition = "2018",
deps = ["@hello_cargo_manifest_dir"],
deps = ["@rules_rust_example_cargo_manifest_dir//:external_crate"],
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

use hello_cargo_manifest_dir::get_included_str;
use external_crate::get_included_str;

#[test]
fn test_lib_with_include() {
Expand Down
8 changes: 4 additions & 4 deletions examples/examples_transitive_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def transitive_deps(is_top_level = False):
if is_top_level:
maybe(
native.local_repository,
name = "hello_cargo_manifest_dir",
path = "examples/hello_cargo_manifest_dir",
name = "rules_rust_example_cargo_manifest_dir",
path = "examples/cargo_manifest_dir/external_crate",
)
else:
maybe(
native.local_repository,
name = "hello_cargo_manifest_dir",
path = "hello_cargo_manifest_dir",
name = "rules_rust_example_cargo_manifest_dir",
path = "cargo_manifest_dir/external_crate",
)