From 3bb748647a31f4af2de88cde526f64c91fee5502 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Tue, 19 Mar 2024 13:46:36 -0500 Subject: [PATCH 1/2] windows-core bindings --- .github/workflows/clippy.yml | 1 - .github/workflows/test.yml | 3 +-- crates/libs/core/Cargo.toml | 4 ++++ crates/libs/core/tests/bindings.rs | 8 ++++++++ crates/{tools/core => libs/core/tests}/bindings.txt | 2 +- crates/{tools/core => libs/core/tests}/com_bindings.txt | 2 +- crates/tools/core/Cargo.toml | 8 -------- crates/tools/core/src/main.rs | 7 ------- 8 files changed, 15 insertions(+), 20 deletions(-) create mode 100644 crates/libs/core/tests/bindings.rs rename crates/{tools/core => libs/core/tests}/bindings.txt (98%) rename crates/{tools/core => libs/core/tests}/com_bindings.txt (94%) delete mode 100644 crates/tools/core/Cargo.toml delete mode 100644 crates/tools/core/src/main.rs diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index afc3bf8d3e..14842e56fa 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -141,7 +141,6 @@ jobs: cargo clippy -p test_win32_arrays && cargo clippy -p test_window_long && cargo clippy -p test_winrt && - cargo clippy -p tool_core && cargo clippy -p tool_gnu && cargo clippy -p tool_lib && cargo clippy -p tool_license && diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e63cf341c3..eff8b373ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -107,8 +107,8 @@ jobs: cargo test -p test_dispatch && cargo test -p test_does_not_return && cargo test -p test_enums && - cargo test -p test_error && cargo clean && + cargo test -p test_error && cargo test -p test_event && cargo test -p test_extensions && cargo test -p test_handles && @@ -149,7 +149,6 @@ jobs: cargo test -p test_win32_arrays && cargo test -p test_window_long && cargo test -p test_winrt && - cargo test -p tool_core && cargo test -p tool_gnu && cargo test -p tool_lib && cargo test -p tool_license && diff --git a/crates/libs/core/Cargo.toml b/crates/libs/core/Cargo.toml index 2c580a7701..8d560e92f9 100644 --- a/crates/libs/core/Cargo.toml +++ b/crates/libs/core/Cargo.toml @@ -28,3 +28,7 @@ path = "../result" [dependencies] windows-implement = { path = "../implement", version = "0.53" } windows-interface = { path = "../interface", version = "0.53" } + +[dev-dependencies.windows-bindgen] +version = "0.55" +path = "../bindgen" diff --git a/crates/libs/core/tests/bindings.rs b/crates/libs/core/tests/bindings.rs new file mode 100644 index 0000000000..468b8fb49d --- /dev/null +++ b/crates/libs/core/tests/bindings.rs @@ -0,0 +1,8 @@ +use windows_bindgen::*; + +#[test] +fn bindings() -> Result<()> { + bindgen(["--etc", "tests/bindings.txt"])?; + bindgen(["--etc", "tests/com_bindings.txt"])?; + Ok(()) +} diff --git a/crates/tools/core/bindings.txt b/crates/libs/core/tests/bindings.txt similarity index 98% rename from crates/tools/core/bindings.txt rename to crates/libs/core/tests/bindings.txt index 37a36bc164..9b6e83a01d 100644 --- a/crates/tools/core/bindings.txt +++ b/crates/libs/core/tests/bindings.txt @@ -1,6 +1,6 @@ // These will use `windows-sys` style bindings. ---out crates/libs/core/src/imp/bindings.rs +--out src/imp/bindings.rs --config flatten sys minimal no-bindgen-comment --filter diff --git a/crates/tools/core/com_bindings.txt b/crates/libs/core/tests/com_bindings.txt similarity index 94% rename from crates/tools/core/com_bindings.txt rename to crates/libs/core/tests/com_bindings.txt index d89ce9fa91..ad4d881461 100644 --- a/crates/tools/core/com_bindings.txt +++ b/crates/libs/core/tests/com_bindings.txt @@ -1,6 +1,6 @@ // These will use `windows` style bindings and include COM APIs. ---out crates/libs/core/src/imp/com_bindings.rs +--out src/imp/com_bindings.rs --config flatten minimal no-bindgen-comment --filter diff --git a/crates/tools/core/Cargo.toml b/crates/tools/core/Cargo.toml deleted file mode 100644 index 60cf975070..0000000000 --- a/crates/tools/core/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "tool_core" -version = "0.0.0" -edition = "2021" -publish = false - -[dependencies.windows-bindgen] -path = "../../libs/bindgen" diff --git a/crates/tools/core/src/main.rs b/crates/tools/core/src/main.rs deleted file mode 100644 index 013d58cce0..0000000000 --- a/crates/tools/core/src/main.rs +++ /dev/null @@ -1,7 +0,0 @@ -use windows_bindgen::*; - -fn main() -> Result<()> { - bindgen(["--etc", "crates/tools/core/bindings.txt"])?; - bindgen(["--etc", "crates/tools/core/com_bindings.txt"])?; - Ok(()) -} From 6898f4576c31fe614dc183433d6074d2e68a7fd7 Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Tue, 19 Mar 2024 13:57:32 -0500 Subject: [PATCH 2/2] gen.yml --- .github/workflows/gen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gen.yml b/.github/workflows/gen.yml index ee9eaa7e1d..dc6aa08659 100644 --- a/.github/workflows/gen.yml +++ b/.github/workflows/gen.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - tool: [windows, sys, yml, license, core, metadata] + tool: [windows, sys, yml, license, metadata] steps: - name: Checkout uses: actions/checkout@v4