AaronRobinsonMSFT / DNNE

Prototype native exports for a .NET Assembly.
MIT License
394 stars 41 forks source link

Add source generator to emit supporting attribute types #181

Closed Sergio0694 closed 10 months ago

Sergio0694 commented 10 months ago

Closes #168

Overview

This PR includes a new dnne-analyzers project, bundling (for now) a generator that produces the supporting attribute types. The setup is pretty much the same as that used in ComputeSharp, the MVVM Toolkit, and several other generators. We have the generator project, a bundled .targets file that is included in the NuGet package that ensures analyzers are either loaded correctly or otherwise produces useful warnings for users, and then some basic props to build and pack the analyzer.

AaronRobinsonMSFT commented 10 months ago

@Sergio0694 Thanks for the help here. I think we need to update to .NET 7 so we can use C# 11. Also, I think the pseudo package is busted. I tried to update it, but the analyzer isn't being chained in as expected. I tried to manually load it in the ExportingAssembly test project but I'm missing something on how analyzers are expected to be loaded.

Sergio0694 commented 10 months ago

I've updated the .NET SDK pulled in from the CI script to be .NET 7 👍 We can keep .NET 6 as TFM in the various projects, of course.

Sergio0694 commented 10 months ago

The resulting package from the CI looks good 😄

image

Question: can't remember, are all .props files in the \build folder picked up by default? As in, don't need anything else here?