Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support msbuild #70

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

IvanJosipovic
Copy link
Contributor

@IvanJosipovic IvanJosipovic commented Nov 3, 2024

This pr shows how we can use MSBuild to get a list of project references and trigger the generation cli

<Target Name="GenerateAvaloniaExtensions" AfterTargets="ResolveReferences">
   <Exec Command="dotnet tool run avalonia-amd-gen --dlls=&quot;@(ReferencePath->'%(FullPath)')&quot; --projectPath=&quot;$(MSBuildProjectFullPath)&quot;" />
</Target>

Todo:

  • Resolve exception enumerating ExternalTypes {"Non-virtual abstract method.":"Avalonia.IDataContextProvider"}
  • Review performance and maybe implement hashing to check if dll changed?
  • Add custom Target to NuGet Package?
  • Install tool using dotnet-tools.json

More info, https://stackoverflow.com/questions/74488608/how-to-run-dotnet-tool-in-prebuild-phase-of-an-sdk-project

Copy link
Collaborator

@gritsenko gritsenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it works

@IvanJosipovic
Copy link
Contributor Author

looks like it works

It might be running the existing version from NuGet. I'm still experiencing an issue enumerating types on my end, seems reflection isn't happy after loading all the dlls. I haven't had a chance to dig into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants