Skip to content

Commit bbccf77

Browse files
authored
Pass through aliases for build dependencies (#1133)
Fixes #1090
1 parent a3492b4 commit bbccf77

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

crate_universe/src/templates/partials/build_script.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ cargo_build_script(
5151
{%- include "templates/partials/targeted_build_script_data_dependencies.template" -%},
5252
{%- else -%},
5353
{%- endif %}
54+
aliases = {%- include "templates/partials/targeted_aliases.template" %},
5455
tags = [
5556
"cargo-raze",
5657
"manual",

examples/crate_universe/basic/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ rust_binary(
77
edition = "2018",
88
deps = [
99
crate("lazy_static"),
10+
crate("value-bag"),
1011
],
1112
)
1213

examples/crate_universe/basic/src/main.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use lazy_static::lazy_static;
22
use std::collections::HashMap;
3+
use value_bag::ValueBag;
34

45
lazy_static! {
56
static ref HASHMAP: HashMap<&'static str, &'static str> = {
@@ -12,6 +13,10 @@ lazy_static! {
1213
}
1314

1415
fn main() {
16+
let bag = ValueBag::capture_display(&42);
17+
let num = bag.to_u64().unwrap();
18+
19+
assert_eq!(num, 42);
1520
assert_eq!(HASHMAP["Daniel"], "Wagner-Hall");
1621
println!("It worked!");
1722
}

examples/crate_universe/basic/workspace.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ def deps():
1010
name = "lazy_static",
1111
semver = "=1.4",
1212
),
13+
crate.spec(
14+
name = "value-bag",
15+
semver = "=1.0.0-alpha.7",
16+
),
1317
],
1418
supported_targets = [
1519
"x86_64-apple-darwin",

0 commit comments

Comments
 (0)