Enhance ResGen tool to support a command line argument#3918
Enhance ResGen tool to support a command line argument#3918daxian-dbw merged 2 commits intoPowerShell:masterfrom
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.
Why not Path.GetDirectoryName(Path.GetDirectoryName(args[0]))?
There was a problem hiding this comment.
Good catch! I'll fix on next week.
|
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.