dart-windows / win32

Build Win32 apps with Dart!
https://win32.pub
BSD 3-Clause "New" or "Revised" License
734 stars 118 forks source link

Migrate to `winmd` v4 #747

Closed halildurmus closed 10 months ago

halildurmus commented 10 months ago

One significant change in this major version is the separation of Win32 metadata from the package. Instead of bundling it with the package, the Win32 metadata is now obtained from the NuGet package Microsoft.Windows.SDK.Win32Metadata. Additionally, this update introduces the capability to load a specific version of the metadata.

These changes eliminate the necessity of locking the winmd dependency to a specific version. Nevertheless, we still need to load a specific metadata version when generating projections and running tests to maintain consistency. To facilitate this, I've introduced a new constant called win32MetadataVersion: https://github.com/dart-windows/win32/blob/53b6445170b5d400c48cf84cfdcf369588c6b5ad/tool/win32gen/lib/src/constants.dart#L1-L7

(Note that the 51.0.33-preview version corresponds to the same metadata that was previously bundled with the winmd v3.)

As explained in the documentation, it is crucial to increment this version only when gearing up for a major release of the win32 package, as such updates may introduce breaking changes in the generated code.