From 0a48da6938ff145b49635962f27a38562fadaddb Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Wed, 15 Nov 2023 11:43:49 -0600 Subject: [PATCH] riddle --- crates/tests/readme/Cargo.toml | 6 ++++++ crates/tests/readme/src/lib.rs | 1 - crates/tools/riddle/Cargo.toml | 3 ++- crates/tools/riddle/readme.md | 28 ++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 crates/tools/riddle/readme.md diff --git a/crates/tests/readme/Cargo.toml b/crates/tests/readme/Cargo.toml index 08c260f61e..04a193bb3f 100644 --- a/crates/tests/readme/Cargo.toml +++ b/crates/tests/readme/Cargo.toml @@ -22,3 +22,9 @@ features = [ "Win32_System_Threading", "Win32_UI_WindowsAndMessaging", ] + +[dependencies.windows-targets] +path = "../../libs/targets" + +[dependencies.windows-metadata] +path = "../../libs/metadata" diff --git a/crates/tests/readme/src/lib.rs b/crates/tests/readme/src/lib.rs index c89354cbc3..fb709b3449 100644 --- a/crates/tests/readme/src/lib.rs +++ b/crates/tests/readme/src/lib.rs @@ -1,4 +1,3 @@ -#![doc = include_str!("../../../../crates/libs/bindgen/readme.md")] #![doc = include_str!("../../../../crates/libs/core/readme.md")] #![doc = include_str!("../../../../crates/libs/metadata/readme.md")] #![doc = include_str!("../../../../crates/libs/sys/readme.md")] diff --git a/crates/tools/riddle/Cargo.toml b/crates/tools/riddle/Cargo.toml index 815ea034de..0a8cde3ff5 100644 --- a/crates/tools/riddle/Cargo.toml +++ b/crates/tools/riddle/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "riddle" -version = "0.0.1" +version = "0.1.0" authors = ["Microsoft"] edition = "2021" rust-version = "1.56" license = "MIT OR Apache-2.0" description = "Windows metadata compiler" repository = "https://github.com/microsoft/windows-rs" +readme = "readme.md" [dependencies.windows-bindgen] path = "../../libs/bindgen" diff --git a/crates/tools/riddle/readme.md b/crates/tools/riddle/readme.md new file mode 100644 index 0000000000..e490b5410d --- /dev/null +++ b/crates/tools/riddle/readme.md @@ -0,0 +1,28 @@ +## Generate Rust bindings for Windows + +The [riddle](https://crates.io/crates/riddle) tool automatically generates Rust bindings from Windows metadata. + +* [Getting started](https://kennykerr.ca/rust-getting-started/) +* [Samples](https://github.com/microsoft/windows-rs/tree/0.52.0/crates/samples) +* [Releases](https://github.com/microsoft/windows-rs/releases) + +Start by installing `riddle`: + +``` +> cargo install riddle +``` + +Generates Rust bindings as needed: + +``` +> riddle +Usage: riddle.exe [options...] + +Options: + --in Path to files and directories containing .winmd and .rdl files + --out Path to .winmd, .rdl, or .rs file to generate + --filter Namespaces to include or !exclude in output + --config Override a configuration value + --format Format .rdl files only + --etc File containing command line options +```