From 5f12cded4de3e381dc3c7c875d698fabf5baa906 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 14 Apr 2020 20:52:19 +0500 Subject: [PATCH 1/8] Resgen.proj works --- .../Microsoft.PowerShell.GraphicalHost.csproj | 51 +++++++++++++++++- .../ResGen.csproj | 53 +++++++++++++++++++ 2 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.Management.UI.Internal/ResGen.csproj diff --git a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj index 466511d6d22..577e0250b0f 100644 --- a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj +++ b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj @@ -1,4 +1,4 @@ - + Assembly containing WPF code for Out-GridView, HelpWindow, and Show-Command @@ -12,6 +12,55 @@ $(DefineConstants);CORECLR + + gen + + + + + + + + + + + + + ResXFileCodeGenerator + CSharp + + $(StronglyTypedOutputFolder)/%(Filename).cs + %(Filename) + $(MSBuildProjectName).resources.%(PSEmbeddedResource.StronglyTypedClassName) + + $([System.String]::new('%(Filename)').StartsWith('Public', System.StringComparison.OrdinalIgnoreCase)) + + $(StronglyTypedOutputFolder)/$([System.String]::Copy('%(Filename)').Substring(7)).cs + $([System.String]::Copy('%(Filename)').Substring(7)) + $(MSBuildProjectName).resources.public.%(PSEmbeddedResource.StronglyTypedClassName) + + + + + + + + + diff --git a/src/Microsoft.Management.UI.Internal/ResGen.csproj b/src/Microsoft.Management.UI.Internal/ResGen.csproj new file mode 100644 index 00000000000..70992fba8f4 --- /dev/null +++ b/src/Microsoft.Management.UI.Internal/ResGen.csproj @@ -0,0 +1,53 @@ + + + + gen + + + + + + + + + + + + ResXFileCodeGenerator + CSharp + + $(StronglyTypedOutputFolder)/%(Filename).cs + CSharp + %(Filename) + + $([System.String]::new('%(Filename)').StartsWith('Public', System.StringComparison.OrdinalIgnoreCase)) + + $(MSBuildProjectName).resources + Microsoft.Management.UI.Internal.resources.public + + $(StronglyTypedOutputFolder)/$([System.String]::Copy('%(Filename)').Substring(7)).cs + $([System.String]::Copy('%(Filename)').Substring(7)) + + + + + + + + + + From 5ea39a83daa4595de371c8be6945934901abb267 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 14 Apr 2020 22:44:59 +0500 Subject: [PATCH 2/8] UI works --- .../Microsoft.PowerShell.GraphicalHost.csproj | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj index 577e0250b0f..e573ff64dab 100644 --- a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj +++ b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj @@ -14,6 +14,7 @@ gen + $([System.String]::Copy('$(MSBuildProjectFile)').Contains('wpftmp')) @@ -22,7 +23,7 @@ - + @@ -32,17 +33,20 @@ $(StronglyTypedOutputFolder)/%(Filename).cs %(Filename) - $(MSBuildProjectName).resources.%(PSEmbeddedResource.StronglyTypedClassName) + Microsoft.PowerShell.GraphicalHost.resources.%(PSEmbeddedResource.StronglyTypedClassName) $([System.String]::new('%(Filename)').StartsWith('Public', System.StringComparison.OrdinalIgnoreCase)) + $(MSBuildProjectName).resources + Microsoft.Management.UI.Internal.resources.public + $(StronglyTypedOutputFolder)/$([System.String]::Copy('%(Filename)').Substring(7)).cs $([System.String]::Copy('%(Filename)').Substring(7)) - $(MSBuildProjectName).resources.public.%(PSEmbeddedResource.StronglyTypedClassName) - - + Microsoft.PowerShell.GraphicalHost.resources.public.%(PSEmbeddedResource.StronglyTypedClassName) + + - + Date: Wed, 15 Apr 2020 23:04:26 +0500 Subject: [PATCH 3/8] Microsoft.Management.UI.Internal works --- .../Microsoft.PowerShell.GraphicalHost.csproj | 19 +++---- .../ResGen.csproj | 53 ------------------- 2 files changed, 8 insertions(+), 64 deletions(-) delete mode 100644 src/Microsoft.Management.UI.Internal/ResGen.csproj diff --git a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj index e573ff64dab..1738ad25602 100644 --- a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj +++ b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj @@ -24,25 +24,22 @@ - - - - ResXFileCodeGenerator CSharp - $(StronglyTypedOutputFolder)/%(Filename).cs - %(Filename) - Microsoft.PowerShell.GraphicalHost.resources.%(PSEmbeddedResource.StronglyTypedClassName) - $([System.String]::new('%(Filename)').StartsWith('Public', System.StringComparison.OrdinalIgnoreCase)) - $(MSBuildProjectName).resources - Microsoft.Management.UI.Internal.resources.public + $(RootNamespace).resources + $(RootNamespace).resources.public + $(StronglyTypedOutputFolder)/%(Filename).cs $(StronglyTypedOutputFolder)/$([System.String]::Copy('%(Filename)').Substring(7)).cs + + %(Filename) $([System.String]::Copy('%(Filename)').Substring(7)) - Microsoft.PowerShell.GraphicalHost.resources.public.%(PSEmbeddedResource.StronglyTypedClassName) + + $(RootNamespace).resources.%(PSEmbeddedResource.StronglyTypedClassName) + $(RootNamespace).resources.public.%(PSEmbeddedResource.StronglyTypedClassName) diff --git a/src/Microsoft.Management.UI.Internal/ResGen.csproj b/src/Microsoft.Management.UI.Internal/ResGen.csproj deleted file mode 100644 index 70992fba8f4..00000000000 --- a/src/Microsoft.Management.UI.Internal/ResGen.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - gen - - - - - - - - - - - - ResXFileCodeGenerator - CSharp - - $(StronglyTypedOutputFolder)/%(Filename).cs - CSharp - %(Filename) - - $([System.String]::new('%(Filename)').StartsWith('Public', System.StringComparison.OrdinalIgnoreCase)) - - $(MSBuildProjectName).resources - Microsoft.Management.UI.Internal.resources.public - - $(StronglyTypedOutputFolder)/$([System.String]::Copy('%(Filename)').Substring(7)).cs - $([System.String]::Copy('%(Filename)').Substring(7)) - - - - - - - - - - From 35df12d97067fd7fbd3fdf37d5bf439e117a077c Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 17 Apr 2020 15:22:56 +0500 Subject: [PATCH 4/8] Rest csproj works --- PowerShell.Common.props | 19 +++++++++++++++++++ build.psm1 | 8 ++++---- ...anagement.Infrastructure.CimCmdlets.csproj | 8 ++++++++ .../Microsoft.PowerShell.GraphicalHost.csproj | 16 +++++++++++++--- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index c2ee2dbf2a2..4adfa27173a 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -111,6 +111,25 @@ true + + gen + + + + + + ResXFileCodeGenerator + CSharp + + %(Filename) + $(RootNamespace).resources + + + + + true + + $(DefineConstants);CORECLR true diff --git a/build.psm1 b/build.psm1 index 2454ada262b..bb5e90649e8 100644 --- a/build.psm1 +++ b/build.psm1 @@ -430,10 +430,10 @@ Fix steps: # handle ResGen # Heuristic to run ResGen on the fresh machine - if ($ResGen -or -not (Test-Path "$PSScriptRoot/src/Microsoft.PowerShell.ConsoleHost/gen")) { - Write-Log -message "Run ResGen (generating C# bindings for resx files)" - Start-ResGen - } + #if ($ResGen -or -not (Test-Path "$PSScriptRoot/src/Microsoft.PowerShell.ConsoleHost/gen")) { + # Write-Log -message "Run ResGen (generating C# bindings for resx files)" + # Start-ResGen + #} # Handle TypeGen # .inc file name must be different for Windows and Linux to allow build on Windows and WSL. diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj b/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj index 582858a592b..01ce8f5da40 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj @@ -6,6 +6,14 @@ Microsoft.Management.Infrastructure.CimCmdlets + + + Strings + Microsoft.Management.Infrastructure.CimCmdlets + $(RootNamespace).resources.%(EmbeddedResource.StronglyTypedClassName) + + + diff --git a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj index 1738ad25602..5063d5aaca1 100644 --- a/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj +++ b/src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj @@ -1,4 +1,4 @@ - + Assembly containing WPF code for Out-GridView, HelpWindow, and Show-Command @@ -17,12 +17,22 @@ $([System.String]::Copy('$(MSBuildProjectFile)').Contains('wpftmp')) - + + ResXFileCodeGenerator CSharp @@ -43,7 +53,7 @@ - + Date: Fri, 17 Apr 2020 15:48:44 +0500 Subject: [PATCH 5/8] Remove ReadyToRun --- PowerShell.Common.props | 4 ---- 1 file changed, 4 deletions(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index 4adfa27173a..fd2921f16dc 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -126,10 +126,6 @@ - - true - - $(DefineConstants);CORECLR true From b7742a49c71fd1c157ae8e3e0ecd6497022bc663 Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 28 May 2020 19:42:45 +0500 Subject: [PATCH 6/8] Put generated files in gen folder --- PowerShell.Common.props | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index fd2921f16dc..d75f90abc2f 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -97,7 +97,7 @@ net5.0 8.0 - true + true true true @@ -115,12 +115,18 @@ gen + + + + ResXFileCodeGenerator CSharp + $(StronglyTypedOutputFolder)/%(Filename).cs %(Filename) $(RootNamespace).resources From 863e9bb3ab9a299a3efd8185187b34287861db48 Mon Sep 17 00:00:00 2001 From: Ilya Date: Mon, 15 Jun 2020 23:26:14 +0500 Subject: [PATCH 7/8] Remove workarround for CimCmdlets project --- .../Microsoft.Management.Infrastructure.CimCmdlets.csproj | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj b/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj index 01ce8f5da40..582858a592b 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj @@ -6,14 +6,6 @@ Microsoft.Management.Infrastructure.CimCmdlets - - - Strings - Microsoft.Management.Infrastructure.CimCmdlets - $(RootNamespace).resources.%(EmbeddedResource.StronglyTypedClassName) - - - From 7e7cf9a10a61ab9c2d9dc37d948a0958c5d94474 Mon Sep 17 00:00:00 2001 From: Ilya Date: Mon, 15 Jun 2020 23:26:29 +0500 Subject: [PATCH 8/8] Add link to comment --- PowerShell.Common.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell.Common.props b/PowerShell.Common.props index d75f90abc2f..1300b5e770d 100644 --- a/PowerShell.Common.props +++ b/PowerShell.Common.props @@ -121,7 +121,7 @@ - + ResXFileCodeGenerator CSharp