Skip to content

Commit

Permalink
[unstable-rust] Use public-dependency Cargo feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid committed Sep 6, 2024
1 parent 8b0cd80 commit eb6f9ed
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[alias]
xtask = "run --quiet --package xtask --"

[unstable]
public-dependency = true
14 changes: 7 additions & 7 deletions all-is-cubes-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ serde = [
]

[dependencies]
arbitrary = { workspace = true, optional = true }
arbitrary = { workspace = true, optional = true, public = true }
bytemuck = { workspace = true, features = ["derive"] }
cfg-if = { workspace = true }
displaydoc = { workspace = true }
embedded-graphics-core = { workspace = true }
embedded-graphics-core = { workspace = true, public = true }
# libm feature to guarantee compilability and compatibility with no_std
euclid = { workspace = true, features = ["libm"] }
euclid = { workspace = true, public = true, features = ["libm"] }
exhaust = { workspace = true, default-features = false }
futures-core = { workspace = true }
futures-util = { workspace = true }
libm = { workspace = true }
manyfmt = { workspace = true }
mutants = { workspace = true }
num-traits = { workspace = true }
ordered-float = { workspace = true }
ordered-float = { workspace = true, public = true }
polonius-the-crab = { workspace = true }
rand = { workspace = true }
re_types = { workspace = true, optional = true }
serde = { workspace = true, optional = true, features = ["derive"] }
rand = { workspace = true, public = true }
re_types = { workspace = true, optional = true, public = true }
serde = { workspace = true, optional = true, public = true, features = ["derive"] }

[dev-dependencies]
indoc = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion all-is-cubes-content/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ harness = false
arbitrary = ["dep:arbitrary", "all-is-cubes/arbitrary"]

[dependencies]
all-is-cubes = { workspace = true }
all-is-cubes = { workspace = true, public = true }
all-is-cubes-ui = { workspace = true }
arbitrary = { workspace = true, optional = true }
exhaust = { workspace = true }
Expand Down
16 changes: 8 additions & 8 deletions all-is-cubes-desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,23 @@ rerun = ["dep:re_sdk", "all-is-cubes/rerun", "all-is-cubes-gpu/rerun"]
# TODO: Define a feature with which to turn off windowing & GPU support.

[dependencies]
all-is-cubes = { workspace = true, features = ["auto-threads", "save"] }
all-is-cubes = { workspace = true, public = true, features = ["auto-threads", "save"] }
# TODO: make template support an optional feature, and this dependency with it
all-is-cubes-content = { workspace = true }
all-is-cubes-gpu = { workspace = true, features = ["auto-threads", "wgpu"] }
all-is-cubes-content = { workspace = true, public = true }
all-is-cubes-gpu = { workspace = true, public = true, features = ["auto-threads", "wgpu"] }
all-is-cubes-mesh = { workspace = true }
# TODO: make all file access an optional feature
all-is-cubes-port = { workspace = true, features = ["import", "native"] }
all-is-cubes-port = { workspace = true, public = true, features = ["import", "native"] }
# TODO: make raytracer optional
all-is-cubes-render = { workspace = true, features = ["raytracer"] }
all-is-cubes-ui = { workspace = true }
all-is-cubes-ui = { workspace = true, public = true }
anyhow = { workspace = true }
cfg-if = { workspace = true }
clap = { workspace = true }
directories-next = "2.0.0"
futures-core = { workspace = true }
gilrs = { workspace = true }
indicatif = { version = "0.17.0", default-features = false }
indicatif = { version = "0.17.0", public = true, default-features = false }
itertools = { workspace = true }
kira = { version = "0.9.4", optional = true, default-features = false, features = ["cpal"] }
log = { workspace = true }
Expand All @@ -82,14 +82,14 @@ serde = { workspace = true }
serde_json = { workspace = true }
simplelog = { workspace = true }
strum = { workspace = true, features = ["derive", "std"] }
tokio = { workspace = true, features = ["rt-multi-thread", "sync"] }
tokio = { workspace = true, public = true, features = ["rt-multi-thread", "sync"] }
ratatui = { version = "0.28.0", optional = true, default-features = false, features = ["crossterm"] }
unicode-width = { workspace = true, optional = true }
# We have no true direct dependency on wgpu, but do need to select backends.
# (As of wgpu 0.19, Vulkan is implicitly enabled on Linux.)
wgpu = { workspace = true, features = ["dx12", "metal"] }
# Note on feature selection: winit requires either "x11" or "wayland" to build at all on Linux, which is harmless elsewhere. I picked x11 because it should be the most compatible.
winit = { version = "0.30.0", default-features = false, features = ["x11", "rwh_06"] }
winit = { version = "0.30.0", public = true, default-features = false, features = ["x11", "rwh_06"] }
# Enable the log_hiccups feature
yield-progress = { workspace = true, features = ["log_hiccups"] }

Expand Down
7 changes: 3 additions & 4 deletions all-is-cubes-gpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ auto-threads = [

[dependencies]
all-is-cubes = { workspace = true, features = ["std"] }
all-is-cubes-mesh = { workspace = true }
all-is-cubes-render = { workspace = true, features = ["raytracer"] }
all-is-cubes-mesh = { workspace = true, public = true }
all-is-cubes-render = { workspace = true, public = true, features = ["raytracer"] }
bytemuck = { workspace = true, features = ["derive"] }
cfg-if = { workspace = true }
# Used to implement ensure_polled(). Also a `wgpu` dependency already.
Expand Down Expand Up @@ -82,15 +82,14 @@ wasm-bindgen-futures = { workspace = true }
# For initializing tests on web. (This is not a dev-dependency because some of said tests are not in this package.)
web-sys = { version = "0.3.69", features = ["OffscreenCanvas"] }
web-time = { workspace = true }
wgpu = { workspace = true, optional = true }
wgpu = { workspace = true, optional = true, public = true }

[target.'cfg(target_family = "wasm")'.dependencies]
# Used in the `poll` module to implement timeout
gloo-timers = { version = "0.3.0", default-features = false, features = ["futures"]}
# If we don't set this feature, it will try to access files at run time and fail
# since web wasm has no std::fs.
resource = { version = "0.5.0", features = ["force-static"] }
wgpu = { workspace = true, optional = true }

[dev-dependencies]
criterion = { workspace = true, features = ["async_tokio"] }
Expand Down
4 changes: 2 additions & 2 deletions all-is-cubes-mesh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ auto-threads = ["dep:rayon"]


[dependencies]
all-is-cubes = { workspace = true }
all-is-cubes-render = { workspace = true }
all-is-cubes = { workspace = true, public = true }
all-is-cubes-render = { workspace = true, public = true }
arbitrary = { workspace = true, optional = true }
bitvec = { workspace = true }
bytemuck = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions all-is-cubes-port/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ dot-vox = [
[dependencies]
# Non-optional generally required dependencies
# need all-is-cubes/std because we have boxed Send futures
all-is-cubes = { workspace = true, features = ["std"] }
all-is-cubes = { workspace = true, public = true, features = ["std"] }
cfg-if = { workspace = true }
futures-core = { workspace = true }
itertools = { workspace = true }
# TODO: replace logging with explicit reporting data flow
log = { workspace = true }
log = { workspace = true, public = true }
thiserror = { workspace = true }

# Dependencies related to formats
all-is-cubes-mesh = { workspace = true, optional = true }
all-is-cubes-mesh = { workspace = true, optional = true, public = true }
all-is-cubes-render = { workspace = true, optional = true }
dot_vox = { version = "5.1.1", optional = true }
stl_io = { version = "0.8.1", optional = true }
Expand All @@ -80,7 +80,7 @@ serde_json = { workspace = true, optional = true }
base64 = { workspace = true, optional = true, features = ["alloc"] }
bytemuck = { workspace = true, optional = true, features = ["derive"] }
# gltf-json often has semver-incompatible changes, so pin it
gltf-json = { version = ">=1.4.1, <1.5.0", optional = true, default-features = false, features = ["names", "KHR_materials_volume", "KHR_materials_transmission"] }
gltf-json = { version = ">=1.4.1, <1.5.0", optional = true, public = true, default-features = false, features = ["names", "KHR_materials_volume", "KHR_materials_transmission"] }
# Used to write glTF textures
image = { workspace = true, optional = true, features = ["png"] }
rectangle-pack = { workspace = true, optional = true }
Expand Down
4 changes: 2 additions & 2 deletions all-is-cubes-render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ auto-threads = ["std", "dep:rayon"]
raytracer = []

[dependencies]
all-is-cubes = { workspace = true }
all-is-cubes = { workspace = true, public = true }
bitflags = { workspace = true }
displaydoc = { workspace = true }
# Used to render overlay info text.
embedded-graphics = { workspace = true }
futures-core = { workspace = true }
imgref = { workspace = true }
imgref = { workspace = true, public = true }
indoc = { workspace = true }
rayon = { workspace = true, optional = true }

Expand Down
6 changes: 3 additions & 3 deletions all-is-cubes-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ bench = false

[dependencies]
# TODO: Disable default features. Requires more `maybe_sync` work.
all-is-cubes = { workspace = true, default-features = true }
all-is-cubes-render = { workspace = true, default-features = true }
async_fn_traits = { workspace = true }
all-is-cubes = { workspace = true, public = true, default-features = true }
all-is-cubes-render = { workspace = true, public = true, default-features = true }
async_fn_traits = { workspace = true, public = true }
displaydoc = { workspace = true }
exhaust = { workspace = true }
flume = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion all-is-cubes-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ crate-type = ["lib", "cdylib"]

[dependencies]
all-is-cubes = { path = "../all-is-cubes", version = "0.8.0" }
all-is-cubes-content = { path = "../all-is-cubes-content", version = "0.8.0" }
all-is-cubes-content = { path = "../all-is-cubes-content", version = "0.8.0", public = true }
all-is-cubes-gpu = { path = "../all-is-cubes-gpu", version = "0.8.0", features = ["wgpu"] }
all-is-cubes-port = { path = "../all-is-cubes-port", version = "0.8.0", features = ["import", "all-formats"] }
all-is-cubes-render = { path = "../all-is-cubes-render", version = "0.8.0" }
Expand Down
29 changes: 15 additions & 14 deletions all-is-cubes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,46 +90,47 @@ rerun = [
auto-threads = ["std", "dep:rayon"]

[dependencies]
all-is-cubes-base = { workspace = true }
arbitrary = { workspace = true, optional = true }
arcstr = { version = "1.2.0", default-features = false, features = ["serde", "substr"] }
all-is-cubes-base = { workspace = true, public = true }
arbitrary = { workspace = true, optional = true, public = true }
arcstr = { version = "1.2.0", public = true, default-features = false, features = ["serde", "substr"] }
arrayvec = { workspace = true }
base64 = { workspace = true, optional = true, features = ["std"] } # used in serialization
bitflags = { workspace = true }
bytemuck = { workspace = true, features = ["derive"] }
cfg-if = { workspace = true }
displaydoc = { workspace = true }
downcast-rs = { workspace = true, default-features = false }
# When trait upcasting is stable we can replace this with upcasting to dyn Any
downcast-rs = { workspace = true, default-features = false, public = true }
# mint feature to guarantee that our callers can use mint types
# libm feature to guarantee compilability and compatibility with no_std
euclid = { workspace = true, default-features = false, features = ["libm", "mint"] }
embedded-graphics = { workspace = true }
exhaust = { workspace = true, default-features = false }
embedded-graphics = { workspace = true, public = true }
exhaust = { workspace = true, public = true, default-features = false }
flate2 = { version = "1.0.26", optional = true }
futures-core = { workspace = true }
hashbrown = { workspace = true }
hashbrown = { workspace = true, public = true }
indoc = { workspace = true }
itertools = { workspace = true }
log = { workspace = true }
manyfmt = { workspace = true }
log = { workspace = true, public = true }
manyfmt = { workspace = true, public = true }
mutants = { workspace = true }
num-traits = { workspace = true }
ordered-float = { workspace = true }
ordered-float = { workspace = true, public = true }
paste = { workspace = true }
png-decoder = { workspace = true }
rand = { workspace = true }
rand = { workspace = true, public = true }
rand_xoshiro = { workspace = true }
rayon = { workspace = true, optional = true }
# re_sdk is a data-logging and visualization tool; we are currently using it _only_ for
# development of All is Cubes itself.
re_log_types = { workspace = true, optional = true }
re_sdk = { workspace = true, optional = true }
re_sdk = { workspace = true, optional = true, public = true }
re_types = { workspace = true, optional = true }
# rc feature needed because we are [de]serializing `Arc`s
# alloc feature needed for #[serde(flatten)] — https://github.com/serde-rs/serde/issues/1935
serde = { workspace = true, optional = true, features = ["alloc", "derive", "rc"] }
serde = { workspace = true, optional = true, public = true, features = ["alloc", "derive", "rc"] }
unicode-segmentation = { workspace = true }
yield-progress = { workspace = true }
yield-progress = { workspace = true, public = true }

[build-dependencies]
all-is-cubes-base = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions test-renderers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ all-is-cubes-content = { workspace = true }
all-is-cubes-gpu = { workspace = true, features = ["wgpu"] }
# used only for gltf export+render tests
all-is-cubes-port = { workspace = true, optional = true, features = ["export", "gltf"] }
all-is-cubes-render = { workspace = true, features = ["raytracer", "std"] }
all-is-cubes-render = { workspace = true, public = true, features = ["raytracer", "std"] }
all-is-cubes-ui = { workspace = true }
async_fn_traits = { workspace = true }
async_fn_traits = { workspace = true, public = true }
bytemuck = { workspace = true, optional = true }
# Using clap for parsing test command-line arguments
clap = { workspace = true }
Expand All @@ -91,7 +91,7 @@ mint = { version = "0.5.9", optional = true }
rend3 = { git = "https://github.com/BVE-Reborn/rend3/", rev = "86bc4d2d2f4048a0adaa9af5ef542dc652308966", optional = true }
rend3-gltf = { git = "https://github.com/BVE-Reborn/rend3/", rev = "86bc4d2d2f4048a0adaa9af5ef542dc652308966", optional = true, default-features = false }
rend3-routine = { git = "https://github.com/BVE-Reborn/rend3/", rev = "86bc4d2d2f4048a0adaa9af5ef542dc652308966", optional = true }
rendiff = { workspace = true }
rendiff = { workspace = true, public = true }
send_wrapper = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand Down

0 comments on commit eb6f9ed

Please sign in to comment.