From 7acc2bf2c8adcc9baca54394a37dd49ac277336b Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Wed, 15 Nov 2023 09:24:25 +0100 Subject: [PATCH] Rename `examples` to `ash-examples` Dependabot complains [1] that: the binary target name `examples` is forbidden, it conflicts with with cargo's build directory names And fails to provide dependency upgrades for Rust code. Fix that by renaming the folder and crate to `ash-examples`. [1]: https://github.com/ash-rs/ash/network/updates/748770724 --- .github/workflows/ci.yml | 2 +- Cargo.toml | 4 ++-- README.md | 16 +++++++--------- {examples => ash-examples}/Cargo.toml | 3 ++- {examples => ash-examples}/assets/rust.png | Bin .../shader/texture/frag.spv | Bin .../shader/texture/texture.frag | 0 .../shader/texture/texture.vert | 0 .../shader/texture/vert.spv | Bin .../shader/triangle/frag.spv | Bin .../shader/triangle/triangle.frag | 0 .../shader/triangle/triangle.vert | 0 .../shader/triangle/vert.spv | Bin {examples => ash-examples}/src/bin/texture.rs | 3 +-- {examples => ash-examples}/src/bin/triangle.rs | 7 ++++--- {examples => ash-examples}/src/lib.rs | 0 generator-rewrite/Cargo.toml | 1 + generator/Cargo.toml | 1 + 18 files changed, 19 insertions(+), 18 deletions(-) rename {examples => ash-examples}/Cargo.toml (92%) rename {examples => ash-examples}/assets/rust.png (100%) rename {examples => ash-examples}/shader/texture/frag.spv (100%) rename {examples => ash-examples}/shader/texture/texture.frag (100%) rename {examples => ash-examples}/shader/texture/texture.vert (100%) rename {examples => ash-examples}/shader/texture/vert.spv (100%) rename {examples => ash-examples}/shader/triangle/frag.spv (100%) rename {examples => ash-examples}/shader/triangle/triangle.frag (100%) rename {examples => ash-examples}/shader/triangle/triangle.vert (100%) rename {examples => ash-examples}/shader/triangle/vert.spv (100%) rename {examples => ash-examples}/src/bin/texture.rs (99%) rename {examples => ash-examples}/src/bin/triangle.rs (99%) rename {examples => ash-examples}/src/lib.rs (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ccf83c7e..ab7db47d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.64.0 - - run: cargo check -p ash-window -p examples --all-features + - run: cargo check -p ash-window -p ash-examples --all-features # TODO: add a similar job for the rewrite once that generates code generated: diff --git a/Cargo.toml b/Cargo.toml index a11a2c018..4138968ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [workspace] members = [ - "examples", + "analysis", "ash", + "ash-examples", "ash-rewrite", "ash-window", - "analysis", "generator", "generator-rewrite", ] diff --git a/README.md b/README.md index d554e42cc..235d48aee 100644 --- a/README.md +++ b/README.md @@ -195,7 +195,7 @@ If, on the other hand, your application cannot handle Vulkan being missing at ru ## Example -You can find the examples [here](https://github.com/ash-rs/ash/tree/master/examples). +You can find the examples [here](https://github.com/ash-rs/ash/tree/master/ash-examples). All examples currently require: the LunarG Validation layers and a Vulkan library that is visible in your `PATH`. An easy way to get started is to use the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/) #### Windows @@ -218,24 +218,22 @@ VK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d \ cargo run ... ``` -### [Triangle](https://github.com/ash-rs/ash/blob/master/examples/src/bin/triangle.rs) +### [Triangle](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/triangle.rs) Displays a triangle with vertex colors. -``` -cd examples -cargo run --bin triangle +```sh +cargo run -p ash-examples --bin triangle ``` ![screenshot](http://i.imgur.com/PQZcL6w.jpg) -### [Texture](https://github.com/ash-rs/ash/blob/master/examples/src/bin/texture.rs) +### [Texture](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/texture.rs) Displays a texture on a quad. -``` -cd examples -cargo run --bin texture +```sh +cargo run -p ash-examples --bin texture ``` ![texture](http://i.imgur.com/trow00H.png) diff --git a/examples/Cargo.toml b/ash-examples/Cargo.toml similarity index 92% rename from examples/Cargo.toml rename to ash-examples/Cargo.toml index 22ddf61fe..853d7ab5e 100644 --- a/examples/Cargo.toml +++ b/ash-examples/Cargo.toml @@ -1,8 +1,9 @@ [package] -name = "examples" +name = "ash-examples" version = "0.1.0" authors = ["maik klein "] edition = "2021" +publish = false [dependencies] image = "0.24" diff --git a/examples/assets/rust.png b/ash-examples/assets/rust.png similarity index 100% rename from examples/assets/rust.png rename to ash-examples/assets/rust.png diff --git a/examples/shader/texture/frag.spv b/ash-examples/shader/texture/frag.spv similarity index 100% rename from examples/shader/texture/frag.spv rename to ash-examples/shader/texture/frag.spv diff --git a/examples/shader/texture/texture.frag b/ash-examples/shader/texture/texture.frag similarity index 100% rename from examples/shader/texture/texture.frag rename to ash-examples/shader/texture/texture.frag diff --git a/examples/shader/texture/texture.vert b/ash-examples/shader/texture/texture.vert similarity index 100% rename from examples/shader/texture/texture.vert rename to ash-examples/shader/texture/texture.vert diff --git a/examples/shader/texture/vert.spv b/ash-examples/shader/texture/vert.spv similarity index 100% rename from examples/shader/texture/vert.spv rename to ash-examples/shader/texture/vert.spv diff --git a/examples/shader/triangle/frag.spv b/ash-examples/shader/triangle/frag.spv similarity index 100% rename from examples/shader/triangle/frag.spv rename to ash-examples/shader/triangle/frag.spv diff --git a/examples/shader/triangle/triangle.frag b/ash-examples/shader/triangle/triangle.frag similarity index 100% rename from examples/shader/triangle/triangle.frag rename to ash-examples/shader/triangle/triangle.frag diff --git a/examples/shader/triangle/triangle.vert b/ash-examples/shader/triangle/triangle.vert similarity index 100% rename from examples/shader/triangle/triangle.vert rename to ash-examples/shader/triangle/triangle.vert diff --git a/examples/shader/triangle/vert.spv b/ash-examples/shader/triangle/vert.spv similarity index 100% rename from examples/shader/triangle/vert.spv rename to ash-examples/shader/triangle/vert.spv diff --git a/examples/src/bin/texture.rs b/ash-examples/src/bin/texture.rs similarity index 99% rename from examples/src/bin/texture.rs rename to ash-examples/src/bin/texture.rs index 482b5c3db..298446c4c 100644 --- a/examples/src/bin/texture.rs +++ b/ash-examples/src/bin/texture.rs @@ -6,8 +6,7 @@ use std::os::raw::c_void; use ash::util::*; use ash::vk; - -use examples::*; +use ash_examples::*; #[derive(Clone, Debug, Copy)] struct Vertex { diff --git a/examples/src/bin/triangle.rs b/ash-examples/src/bin/triangle.rs similarity index 99% rename from examples/src/bin/triangle.rs rename to ash-examples/src/bin/triangle.rs index 46eb1ce52..621b57b2e 100644 --- a/examples/src/bin/triangle.rs +++ b/ash-examples/src/bin/triangle.rs @@ -1,12 +1,13 @@ -use ash::util::*; -use ash::vk; -use examples::*; use std::default::Default; use std::ffi::CStr; use std::io::Cursor; use std::mem; use std::mem::align_of; +use ash::util::*; +use ash::vk; +use ash_examples::*; + #[derive(Clone, Debug, Copy)] struct Vertex { pos: [f32; 4], diff --git a/examples/src/lib.rs b/ash-examples/src/lib.rs similarity index 100% rename from examples/src/lib.rs rename to ash-examples/src/lib.rs diff --git a/generator-rewrite/Cargo.toml b/generator-rewrite/Cargo.toml index ba95a8155..08e458ac0 100644 --- a/generator-rewrite/Cargo.toml +++ b/generator-rewrite/Cargo.toml @@ -2,6 +2,7 @@ name = "generator-rewrite" version = "2.0.0" edition = "2021" +publish = false [dependencies] analysis = { path = "../analysis" } diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 8df2ba1da..83fa5578a 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -3,6 +3,7 @@ name = "generator" version = "0.1.0" authors = ["Maik Klein "] edition = "2021" +publish = false [dependencies] bindgen = "0.64"