From c14b85a00c03933c708c7d38fefeda9898a21488 Mon Sep 17 00:00:00 2001 From: Jeff Kluge Date: Mon, 15 Nov 2021 15:36:51 -0800 Subject: [PATCH] Make ILMerge targets incremental (#4337) --- .../NuGet.CommandLine.csproj | 30 ++++++++---- .../NuGet.MSSigning.Extensions.csproj | 20 ++++++-- .../NuGet.Build.Tasks.Pack.csproj | 48 ++++++++++++++----- .../NuGet.Packaging.Extraction.csproj | 29 +++++++++-- .../NuGet.Packaging.Extraction/ilmerge.props | 15 ------ 5 files changed, 98 insertions(+), 44 deletions(-) delete mode 100644 src/NuGet.Core/NuGet.Packaging.Extraction/ilmerge.props diff --git a/src/NuGet.Clients/NuGet.CommandLine/NuGet.CommandLine.csproj b/src/NuGet.Clients/NuGet.CommandLine/NuGet.CommandLine.csproj index f9536f13f1b..fd2faeb66c1 100644 --- a/src/NuGet.Clients/NuGet.CommandLine/NuGet.CommandLine.csproj +++ b/src/NuGet.Clients/NuGet.CommandLine/NuGet.CommandLine.csproj @@ -93,30 +93,42 @@ - - - + - - 0 + $(OutputPath)NuGet.exe + $(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe + + + + + + + + + 0 + - $(OutputPath)NuGet.exe - $(ILMergeExePath) /lib:$(OutputPath) /out:$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.exe @(MergeAllowDup -> '/allowdup:%(Identity)', ' ') /log:$(OutputPath)IlMergeLog.txt + $(ILMergeExePath) /lib:$(OutputPath) /out:$(PathToMergedNuGetExe) @(MergeAllowDup -> '/allowdup:%(Identity)', ' ') /log:$(OutputPath)IlMergeLog.txt $(IlmergeCommand) /delaysign /keyfile:$(MS_PFX_PATH) $(IlmergeCommand) $(PathToBuiltNuGetExe) @(BuildArtifacts->'%(filename)%(extension)', ' ') @(LocalizedArtifacts->'%(fullpath)', ' ') - + diff --git a/src/NuGet.Clients/NuGet.MSSigning.Extensions/NuGet.MSSigning.Extensions.csproj b/src/NuGet.Clients/NuGet.MSSigning.Extensions/NuGet.MSSigning.Extensions.csproj index 6ef506a510c..4a4e60597b5 100644 --- a/src/NuGet.Clients/NuGet.MSSigning.Extensions/NuGet.MSSigning.Extensions.csproj +++ b/src/NuGet.Clients/NuGet.MSSigning.Extensions/NuGet.MSSigning.Extensions.csproj @@ -31,17 +31,29 @@ - + + + $(OutputPath)NuGet.exe + $(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.Mssign.exe + + + + + - $(OutputPath)NuGet.exe - $(ILMergeExePath) $(PathToBuiltNuGetExe) /lib:$(OutputPath) @(BuildArtifacts->'%(filename)%(extension)', ' ') /out:$(ArtifactsDirectory)$(VsixOutputDirName)\NuGet.Mssign.exe @(MergeAllowDup -> '/allowdup:%(Identity)', ' ') + $(ILMergeExePath) $(PathToBuiltNuGetExe) /lib:$(OutputPath) @(BuildArtifacts->'%(filename)%(extension)', ' ') /out:$(PathToMergedNuGetExe) @(MergeAllowDup -> '/allowdup:%(Identity)', ' ') $(IlmergeCommand) /delaysign /keyfile:$(MS_PFX_PATH) - + diff --git a/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj b/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj index c94acffd885..21e3f97a88a 100644 --- a/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj +++ b/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.csproj @@ -1,4 +1,4 @@ - + @@ -85,16 +85,29 @@ - + - $(OutputPath)ilmerge + $(OutputPath)NuGet.Build.Tasks.Pack.dll + $(OutputPath)ilmerge\NuGet.Build.Tasks.Pack.dll - + + + + + + $([System.IO.Path]::GetDirectoryName($(PathToMergedNuGetPack))) + + + + - $(ILMergeResultDir)\NuGet.Build.Tasks.Pack.dll $(ILMergeExePath) ^ /out:$(PathToMergedNuGetPack) ^ $(ILMergePlatformArg) ^ @@ -106,22 +119,35 @@ /delaysign ^ /keyfile:$(MS_PFX_PATH) $(IlmergeCommand) ^ - $(OutputPath)NuGet.Build.Tasks.Pack.dll ^ + $(PathToBuiltNuGetPack) ^ @(BuildArtifacts, ' ') - + - $(OutputPath)ilmerge\$(CurrentCulture) + $(OutputPath)$(CurrentCulture)NuGet.Build.Tasks.Pack.resources.dll + $(OutputPath)ilmerge\$(CurrentCulture)NuGet.Build.Tasks.Pack.resources.dll - + + + + + + $([System.IO.Path]::GetDirectoryName($(PathToMergedNuGetPackResource))) + + + + - $(ILMergeResultDir)NuGet.Build.Tasks.Pack.resources.dll $(ILMergeExePath) ^ /out:$(PathToMergedNuGetPackResource) ^ $(ILMergePlatformArg) ^ @@ -134,7 +160,7 @@ /delaysign ^ /keyfile:$(MS_PFX_PATH) $(IlmergeCommand) ^ - $(OutputPath)$(CurrentCulture)NuGet.Build.Tasks.Pack.resources.dll ^ + $(PathToBuiltNuGetPackResource) ^ @(ResourceArtifacts, ' ') diff --git a/src/NuGet.Core/NuGet.Packaging.Extraction/NuGet.Packaging.Extraction.csproj b/src/NuGet.Core/NuGet.Packaging.Extraction/NuGet.Packaging.Extraction.csproj index 8ab9f1459c2..18f73cf831a 100644 --- a/src/NuGet.Core/NuGet.Packaging.Extraction/NuGet.Packaging.Extraction.csproj +++ b/src/NuGet.Core/NuGet.Packaging.Extraction/NuGet.Packaging.Extraction.csproj @@ -1,7 +1,6 @@ - NuGet's understanding of packages. Reading nuspec, nupkgs and package signing. @@ -348,13 +347,33 @@ - + + + $(OutputPath)NuGet.Packaging.Extraction.dll + $(ILMergeDirectory)NuGet.Packaging.Extraction.dll + - + + + + + + + + + + + + + + - $(OutputPath)NuGet.Packaging.Extraction.dll - $(ILMergeExePath) /lib:$(OutputPath) /t:library /out:$(ILMergeDirectory)NuGet.Packaging.Extraction.dll @(MergeAllowDup -> '/allowdup:%(Identity)', ' ') + $(ILMergeExePath) /lib:$(OutputPath) /t:library /out:$(PathToMergedNPE) @(MergeAllowDup -> '/allowdup:%(Identity)', ' ') $(IlmergeCommand) /delaysign /keyfile:$(MS_PFX_PATH) $(IlmergeCommand) $(PathToBuiltNPE) @(MergeInclude->'%(fullpath)', ' ') diff --git a/src/NuGet.Core/NuGet.Packaging.Extraction/ilmerge.props b/src/NuGet.Core/NuGet.Packaging.Extraction/ilmerge.props deleted file mode 100644 index d8c8bbaf0ac..00000000000 --- a/src/NuGet.Core/NuGet.Packaging.Extraction/ilmerge.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - -