-
Notifications
You must be signed in to change notification settings - Fork 11
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
Is MSBuild truly necesary? #69
Comments
Copying my comments from dotnet/msbuild#9389 as requested by @rainersigwald: Compare to the Microsoft.Build.Tasks.Git package, which provides MSBuild tasks and does not depend on any NuGet packages -- it instead assumes that the process has already loaded the MSBuild DLLs. https://nuget.info/packages/Antlr4BuildTasks/12.4.0 shows
The System.Text.Encoding.CodePages assembly dependency seems a bit suspect; I'm not sure that's always available in the MSBuild process, and I don't think the NuGet dependencies of Antlr4BuildTasks matter for that purpose at all. In other words, Antlr4BuildTasks should
|
@kaby76, we've discovered some problems related to This has worked fine on .NET 8, but we quickly got reports from users that it failed at runtime in .NET 6 environments due to not finding the I didn't really find a workaround with the newer versions, so I switched back to If I understood it correctly, it basically caused runtime errors for packages that referenced |
This is caused by Antlr4BuildTasks requiring Microsoft.Build.Utilities.Core which requires System.Text.Encoding.CodePages. Assuming that changes in the API are backward compatible, try adding |
Thanks! I did try it with I'm not really sure how to solve that, either. I don't have a lot of experience with building build tools for .NET. My first idea would probably be to try to somehow inline the dependencies, so the required dlls for |
Citing @masonwheeler's very helpful change from the other referenced thread in case anyone lands here - this fixed the issue of unneeded dependencies being copied to the output folder. I didn't notice any unwanted side effects. - <PackageReference Include="Antlr4BuildTasks" Version="12.4.0" />
+ <PackageReference Include="Antlr4BuildTasks" Version="12.4.0" PrivateAssets="all" IncludeAssets="build" /> |
The MSBuild dependencies make this code generator very heavyweight, transitively dragging over 30 other dependencies into the project, including bizarre things like
System.Drawing.Common
and a whole host of security/permissions related things, none of which feel like they have anything to do with running a simple code generator. (Or even a not-so-simple one that has to hand the code generation work off to a Java process.)Would it be possible to produce a lightweight code generator package for those of us whose only use case is running the code generation and not any of the build-system stuff? Or is MSBuild somehow integral to that?
The text was updated successfully, but these errors were encountered: