Skip to content

Enhance ResGen tool to support a command line argument - #3918

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
iSazonov:resgen-for-msbuild
Jun 26, 2017
Merged

Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
iSazonov:resgen-for-msbuild

Conversation

@iSazonov

@iSazonov Ilya (iSazonov) commented Jun 2, 2017 •

Copy link
Copy Markdown
Collaborator

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.

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.
@vors

Copy link
Copy Markdown
Collaborator

I think it's a good idea.

We will clean up Build.psm1 and modify csproj files to use the new feature of ResGen tool for faster project build.

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.
Let's just expose this functionality thru Start-ResGen optional parameter in the same PR.

@iSazonov

Copy link
Copy Markdown
Collaborator Author

Yes, it is all for MSBuild - I updated the comment.

@vors

Copy link
Copy Markdown
Collaborator

oh, do you mean that you know how to plug it into csproj files so it's called automatically?

@iSazonov

Copy link
Copy Markdown
Collaborator Author

Yes. You can see sample in #3870

@iSazonov

Copy link
Copy Markdown
Collaborator Author

Travis Plunk (@TravisEz13) Is the PR ready to merge?

Comment thread 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;

Copy link
Copy Markdown
Member

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]))?

Copy link
Copy Markdown
Collaborator Author

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@daxian-dbw

Copy link
Copy Markdown
Member

LGTM except for a minor comment.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 9e41c64 into PowerShell:master Jun 26, 2017
@iSazonov
Ilya (iSazonov) deleted the resgen-for-msbuild branch June 26, 2017 18:13
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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.

5 participants