-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Enhance ResGen tool to support a command line argument #3918
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
Conversation
ResGen tool process all resx files in PowerShell Repo at a time. Now we can process resx files one at a time. It is useful for MSBuild.
3e05e0c to
5f5e49c
Compare
|
I think it's a good idea.
Couple comments: I don't think we should try to be smart and auto-detect set of files for resgen in build.psm1. We should just figure out the way to switch to msbuild resgen sooner or later. |
|
Yes, it is all for MSBuild - I updated the comment. |
|
oh, do you mean that you know how to plug it into csproj files so it's called automatically? |
|
Yes. You can see sample in #3870 |
|
@TravisEz13 Is the PR ready to merge? |
src/ResGen/Program.cs
Outdated
| { | ||
| // We are assuming resgen is run with 'dotnet run pathToResxFile.resx'. | ||
| fileFilter = Path.GetFileName(args[0]); | ||
| string moduleDirectory = Directory.GetParent(Path.GetDirectoryName(args[0])).FullName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Path.GetDirectoryName(Path.GetDirectoryName(args[0]))?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I'll fix on next week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
LGTM except for a minor comment. |
Related #3400
Motivation
ResGen tool process all resx files in PowerShell Repo at a time. It is not problem because it works very fast. But updating multiple cs files causes all Repo projects to be recompiled. It really slows down.
We still can not use native resgen from dotnet-cli. See #2882 (comment)
So we should enhance our ResGen tool, use MSBuild capabilities and process resx files one at a time to avoid unnecessary rebuilds.
Fix
We can specify a resx file path parameter on the command line and process resx files one at a time.
Follow-Up work
We will clean up Build.psm1 and modify csproj files to use the new feature of ResGen tool with MSBuild for faster project build.