Dependencies include:
Except for the SDK, WinRT components will include both metadata (winmd files) and executable binaries (DLL files) and most WinRT components are already distributed via nuget so perhaps the winrt::import macro needs to know how to unpack them directly.
Talking with @kennykerr about this, this is our plan for action:
import! macro will not do any network requests.For nuget:
nuget_dependencies key to the Cargo.toml manifest section. cargo-nuget which can read that section and store it in a well known place. import! macro can then read nuget dependencies from that well known place. Is it possible to import type for Microsoft.Update.Session?
@rylev @kennykerr it looks like the impl of this has changed since #118 was merged and this doesn't appear to be doc'd anywhere. Is there currently support for generating bindings for 3rd party winmd's? Trying to pull in Win2D.
You'll need to place the winmd files you wish to generate bindings for in the .windows/winmd folder. You'll also have to place the binaries in the .windows/[arch] folder (e.g. .windows/x64). In addition, you'll need to place the appropriate binaries from the Microsoft.VCRTForwarders.140 nuget package in that folder as well. From there, just include the desired namespaces/types in your windows::build! macro.
Checkout Kenny's Win2D sample as a guide.
I've added Win2D to the samples repo: https://github.com/kennykerr/samples-rs
Note that the windows crate first attempts to load metadata from the .windows/winmd folder, that Robert mentioned. Only if no winmd files are found will it fall back to the default metadata.
Most helpful comment
Talking with @kennykerr about this, this is our plan for action:
import!macro will not do any network requests.For nuget:
nuget_dependencieskey to the Cargo.toml manifest section.cargo-nugetwhich can read that section and store it in a well known place.import!macro can then read nuget dependencies from that well known place.