Skip to content

Commit 67c2720

Browse files
committed
Go back to api_gen depending on windows-bindgen, riddle remains unpublished
1 parent 655a151 commit 67c2720

File tree

6 files changed

+30
-6
lines changed

6 files changed

+30
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@ jobs:
4949
with:
5050
name: metadata
5151
path: .windows/winmd
52-
- name: Install riddle
53-
run: cargo install --git https://github.com/microsoft/windows-rs --rev f18811c riddle
5452
- name: Generate
55-
run: riddle --etc bindings.txt
53+
run: cargo r -p api_gen
5654
- name: Upload crate source
5755
uses: actions/upload-artifact@v3
5856
with:
5957
name: crate-source
6058
path: src/
6159
- name: Diff generated Rust code
62-
run: test -z "$(git status --porcelain -- '!.windows')" || (echo "::error::Generated files are different, please regenerate with riddle --etc bindings.txt!"; git diff; false)
60+
run: test -z "$(git status --porcelain -- '!.windows')" || (echo "::error::Generated files are different, please regenerate with cargo run -p api_gen!"; git diff; false)

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,5 @@ dotnet build .metadata
3535
From the root of the repository:
3636

3737
```sh
38-
cargo install --git https://github.com/microsoft/windows-rs --rev f18811c riddle
39-
riddle --etc bindings.txt
38+
cargo run -p api_gen
4039
```

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ features = [
2323
"Win32_Graphics_Direct3D12",
2424
"Win32_Graphics_Dxgi_Common",
2525
]
26+
27+
[workspace]
28+
members = ["api_gen"]

api_gen/Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[package]
2+
name = "api_gen"
3+
version = "0.0.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[dependencies]
8+
anyhow = "1"
9+
windows-bindgen = "0.51"
10+
windows-metadata = "0.51"

api_gen/src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use windows_bindgen::{bindgen, Result};
2+
3+
fn main() -> Result<()> {
4+
let log = bindgen(["--etc", "bindings.txt"])?;
5+
println!("{}", log);
6+
Ok(())
7+
}

release.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,10 @@ pre-release-replacements = [
99
{ file = "README.md", search = "amd-ext-d3d = .*", replace = "{{crate_name}} = \"{{version}}\"" },
1010
]
1111

12+
# cargo-release only allows using {{version}} in the commit title when creating one
13+
# commit across all released packages in this workspace (we only release one package
14+
# though), or by using the same version for all packages.
15+
# https://github.com/crate-ci/cargo-release/issues/540#issuecomment-1328769105
16+
# https://github.com/crate-ci/cargo-release/commit/3af94caa4b9bbee010a5cf3f196cc4afffbaf192
17+
consolidate-commits = false
18+
shared-version = true

0 commit comments

Comments
 (0)