|
38 | 38 | </ItemGroup>
|
39 | 39 |
|
40 | 40 | <ItemGroup>
|
41 |
| - <PackageReference Include="ILMerge" PrivateAssets="All" Condition=" '$(DotNetBuildSourceOnly)' != 'true' " /> |
42 | 41 | <None Include="$(BuildCommonDirectory)NOTICES.txt" Pack="true" PackagePath="\" />
|
43 | 42 | </ItemGroup>
|
44 | 43 |
|
|
63 | 62 | </EmbeddedResource>
|
64 | 63 | </ItemGroup>
|
65 | 64 |
|
66 |
| - <Target |
67 |
| - Name="PublishAndMergePackNupkg" |
68 |
| - AfterTargets="AfterBuild" |
69 |
| - Condition="'$(TargetFramework)' != '' AND '$(IsXPlat)' != 'true' AND '$(DotNetBuildSourceOnly)' != 'true' AND '$(BuildingInsideVisualStudio)' != 'true'"> |
70 |
| - <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish;ILMergeNuGetPack;ILMergeNuGetPackResourcesPerCulture" /> |
71 |
| - </Target> |
72 |
| - |
73 |
| - <Target Name="ILMergeNuGetPackResourcesPerCulture" DependsOnTargets="Publish"> |
74 |
| - <ItemGroup> |
75 |
| - <_PackResourceDlls Include="$(OutputPath)publish\**\$(AssemblyName).resources.dll" /> |
76 |
| - </ItemGroup> |
77 |
| - <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="ILMergeNuGetPackResources" |
78 |
| - Properties="CurrentCulture=%(_PackResourceDlls.RecursiveDir); |
79 |
| - BuildProjectReferences=false"> |
80 |
| - </MSBuild> |
81 |
| - </Target> |
82 |
| - |
83 |
| - <Target Name="GetILMergePlatformArg" DependsOnTargets="ResolveReferences"> |
84 |
| - <ItemGroup> |
85 |
| - <ILMergeMscorlibReferencePath Include="@(ReferencePath)" Condition="'%(ReferencePath.Filename)' == 'mscorlib'" /> |
86 |
| - </ItemGroup> |
87 |
| - <PropertyGroup> |
88 |
| - <ILMergePlatformDir>@(IlmergeMscorlibReferencePath->'%(RootDir)%(Directory)')</ILMergePlatformDir> |
89 |
| - <ILMergePlatformArg>/targetplatform:v4,"$(ILMergePlatformDir.TrimEnd('\/'))"</ILMergePlatformArg> |
90 |
| - </PropertyGroup> |
91 |
| - </Target> |
92 |
| - |
93 |
| - <Target Name="DetermineILMergeNuGetPackInputsOutputs"> |
94 |
| - <PropertyGroup> |
95 |
| - <PathToBuiltNuGetPack>$(OutputPath)NuGet.Build.Tasks.Pack.dll</PathToBuiltNuGetPack> |
96 |
| - <PathToMergedNuGetPack>$(OutputPath)ilmerge\NuGet.Build.Tasks.Pack.dll</PathToMergedNuGetPack> |
97 |
| - </PropertyGroup> |
98 |
| - <ItemGroup> |
99 |
| - <BuildArtifacts Include="$(OutputPath)publish\*.dll" Exclude="$(OutputPath)publish\*Pack.dll" /> |
100 |
| - </ItemGroup> |
101 |
| - <Message Text="$(MSBuildProjectName) -> $(PathToMergedNuGetPack)" Importance="High" /> |
102 |
| - </Target> |
103 |
| - |
104 |
| - <Target Name="ILMergeNuGetPack" |
105 |
| - DependsOnTargets="GetILMergePlatformArg;DetermineILMergeNuGetPackInputsOutputs" |
106 |
| - Inputs="$(PathToBuiltNuGetPack);@(BuildArtifacts)" |
107 |
| - Outputs="$(PathToMergedNuGetPack)" |
108 |
| - Condition="'$(TargetFramework)' != '' AND '$(DotNetBuildSourceOnly)' != 'true' "> |
109 |
| - <PropertyGroup> |
110 |
| - <ILMergeResultDir>$([System.IO.Path]::GetDirectoryName($(PathToMergedNuGetPack)))</ILMergeResultDir> |
111 |
| - </PropertyGroup> |
112 |
| - |
113 |
| - <MakeDir Directories="$(ILMergeResultDir)" /> |
114 |
| - |
115 |
| - <PropertyGroup> |
116 |
| - <IlmergeCommand>$(ILMergeConsolePath) ^ |
117 |
| - /out:$(PathToMergedNuGetPack) ^ |
118 |
| - $(ILMergePlatformArg) ^ |
119 |
| - /allowDup ^ |
120 |
| - /lib:$(OutputPath)publish ^ |
121 |
| - /internalize ^ |
122 |
| - /xmldocs ^ |
123 |
| - /log:$(ILMergeResultDir)IlMergeLog.txt</IlmergeCommand> |
124 |
| - <IlmergeCommand Condition="'$(SkipSigning)' != 'true' And Exists($(AssemblyOriginatorKeyFile))">$(IlmergeCommand) ^ |
125 |
| - /delaysign ^ |
126 |
| - /keyfile:$(AssemblyOriginatorKeyFile)</IlmergeCommand> |
127 |
| - <IlmergeCommand>$(IlmergeCommand) ^ |
128 |
| - $(PathToBuiltNuGetPack) ^ |
129 |
| - @(BuildArtifacts, ' ')</IlmergeCommand> |
130 |
| - <IlmergeCommand Condition=" '$(TargetFramework)' != '$(NETFXTargetFramework)' ">$(IlmergeCommand) ^ |
131 |
| - /lib:$(PkgMicrosoft_Build_Utilities_Core)\ref\netstandard2.0 ^ |
132 |
| - /lib:$(PkgMicrosoft_Build_Tasks_Core)\ref\netstandard2.0 ^ |
133 |
| - /lib:$(PkgMicrosoft_Build_Framework)\ref\netstandard2.0 |
134 |
| - </IlmergeCommand> |
135 |
| - |
136 |
| - </PropertyGroup> |
137 |
| - <Exec Command="$(IlmergeCommand)" ContinueOnError="false" /> |
138 |
| - </Target> |
139 |
| - |
140 |
| - <Target Name="DetermineILMergeNuGetPackResourcesInputsOutputs"> |
141 |
| - <PropertyGroup> |
142 |
| - <PathToBuiltNuGetPackResource>$(OutputPath)$(CurrentCulture)NuGet.Build.Tasks.Pack.resources.dll</PathToBuiltNuGetPackResource> |
143 |
| - <PathToMergedNuGetPackResource>$(OutputPath)ilmerge\$(CurrentCulture)NuGet.Build.Tasks.Pack.resources.dll</PathToMergedNuGetPackResource> |
144 |
| - </PropertyGroup> |
145 |
| - <ItemGroup> |
146 |
| - <ResourceArtifacts Include="$(OutputPath)$(CurrentCulture)NuGet*.resources.dll" Exclude="$(OutputPath)$(CurrentCulture)*Pack.resources.dll" /> |
147 |
| - </ItemGroup> |
148 |
| - <Message Text="$(MSBuildProjectName) -> $(PathToMergedNuGetPackResource)" Importance="High" /> |
149 |
| - </Target> |
150 |
| - |
151 |
| - <Target Name="ILMergeNuGetPackResources" |
152 |
| - DependsOnTargets="GetILMergePlatformArg;DetermineILMergeNuGetPackResourcesInputsOutputs" |
153 |
| - Inputs="$(PathToBuiltNuGetPackResource);@(ResourceArtifacts)" |
154 |
| - Outputs="$(PathToMergedNuGetPackResource)" |
155 |
| - Condition="'$(TargetFramework)' != '' AND '$(CurrentCulture)' != ''"> |
156 |
| - <PropertyGroup> |
157 |
| - <ILMergeResultDir>$([System.IO.Path]::GetDirectoryName($(PathToMergedNuGetPackResource)))</ILMergeResultDir> |
158 |
| - </PropertyGroup> |
159 |
| - |
160 |
| - <MakeDir Directories="$(ILMergeResultDir)" /> |
161 |
| - |
162 |
| - <PropertyGroup> |
163 |
| - <IlmergeCommand>$(ILMergeConsolePath) ^ |
164 |
| - /out:$(PathToMergedNuGetPackResource) ^ |
165 |
| - $(ILMergePlatformArg) ^ |
166 |
| - /allowDup ^ |
167 |
| - /log ^ |
168 |
| - /lib:$(OutputPath)\publish ^ |
169 |
| - /internalize ^ |
170 |
| - /xmldocs ^ |
171 |
| - /log:$(ILMergeResultDir)IlMergeLogResources.txt</IlmergeCommand> |
172 |
| - <IlmergeCommand Condition="'$(SkipSigning)' != 'true' And Exists($(AssemblyOriginatorKeyFile))">$(IlmergeCommand) ^ |
173 |
| - /delaysign ^ |
174 |
| - /keyfile:$(AssemblyOriginatorKeyFile)</IlmergeCommand> |
175 |
| - <IlmergeCommand>$(IlmergeCommand) ^ |
176 |
| - $(PathToBuiltNuGetPackResource) ^ |
177 |
| - @(ResourceArtifacts, ' ')</IlmergeCommand> |
178 |
| - </PropertyGroup> |
179 |
| - <Exec Command="$(IlmergeCommand)" ContinueOnError="false" /> |
180 |
| - </Target> |
181 |
| - |
182 |
| - <!--These targets help get all the DLLs that are packed in the nuspec to be sent for signing.--> |
183 |
| - <Target Name="GetIlmergeBuildOutput" DependsOnTargets="ILMergeNuGetPackResourcesPerCulture;_GetDllsInOutputDirectory" Returns="@(DllsToSign)"> |
184 |
| - <ItemGroup> |
185 |
| - <DllsToSign Include="@(DllsInOutputDir)" KeepDuplicates="false" /> |
186 |
| - </ItemGroup> |
187 |
| - </Target> |
188 |
| - |
189 |
| - <Target Name="_GetDllsInOutputDirectory" Returns="@(DllsInOutputDir)"> |
190 |
| - <ItemGroup> |
191 |
| - <DllsInOutputDir Include="$(OutputPath)ilmerge\*.dll" KeepDuplicates="false"> |
192 |
| - <StrongName>MsSharedLib72</StrongName> |
193 |
| - <Authenticode>Microsoft400</Authenticode> |
194 |
| - </DllsInOutputDir> |
195 |
| - <DllsInOutputDir Include="$(OutputPath)ilmerge\*.xml" KeepDuplicates="false"> |
196 |
| - <Authenticode>MicrosoftXmlSHA2</Authenticode> |
197 |
| - </DllsInOutputDir> |
198 |
| - </ItemGroup> |
199 |
| - </Target> |
200 |
| - |
201 |
| - <!--These targets help get all the DLLs that are packed in the nuspec to be sent for signing.--> |
202 |
| - <Target Name="GetIlmergeSymbolOutput" Returns="@(SymbolsToIndex)"> |
203 |
| - <ItemGroup> |
204 |
| - <SymbolsToIndex Include="$(OutputPath)ilmerge\*.pdb" KeepDuplicates="false" /> |
205 |
| - </ItemGroup> |
206 |
| - </Target> |
207 |
| - |
208 |
| - <Target Name="GetFinalBuildOutput" Returns="@(DllsToIndex)"> |
209 |
| - <ItemGroup> |
210 |
| - <DllsToIndex Include="$(OutputPath)ilmerge\NuGet.Build.Tasks.Pack.dll"/> |
211 |
| - </ItemGroup> |
212 |
| - </Target> |
213 |
| - |
214 | 65 | <Target Name="CreatePackNupkg">
|
215 | 66 | <PropertyGroup>
|
216 |
| - <!-- Build from source can't use ILMerge and XPLat builds don't run the ILmerge targets. --> |
217 |
| - <ILMergeSubpath Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(IsXPlat)' != 'true'">ilmerge\</ILMergeSubpath> |
218 | 67 | <PackagePathDir Condition="'$(TargetFramework)' == '$(NETFXTargetFramework)'">Desktop/</PackagePathDir>
|
219 | 68 | <PackagePathDir Condition="'$(TargetFramework)' == '$(NetStandardVersion)'">CoreCLR/</PackagePathDir>
|
220 | 69 | </PropertyGroup>
|
221 | 70 | <ItemGroup>
|
222 |
| - <TfmSpecificPackageFile Include="$(OutputPath)\$(ILMergeSubpath)NuGet.Build.Tasks.Pack.dll" Condition="'$(DotNetBuildSourceOnly)' != 'true'"> |
| 71 | + <TfmSpecificPackageFile Include="$(OutputPath)**\NuGet*.resources.dll"> |
223 | 72 | <PackagePath>$(PackagePathDir)</PackagePath>
|
224 | 73 | </TfmSpecificPackageFile>
|
225 |
| - <TfmSpecificPackageFile Include="$(OutputPath)\$(ILMergeSubpath)**\NuGet*.resources.dll" Exclude="$(OutputPath)\$(ILMergeSubpath)publish\**\NuGet*.resources.dll"> |
226 |
| - <PackagePath>$(PackagePathDir)</PackagePath> |
227 |
| - </TfmSpecificPackageFile> |
228 |
| - <TfmSpecificPackageFile Include="$(OutputPath)\$(ILMergeSubpath)NuGet*.dll" Condition="'$(DotNetBuildSourceOnly)' == 'true'"> |
| 74 | + <TfmSpecificPackageFile Include="$(OutputPath)*.dll"> |
229 | 75 | <PackagePath>$(PackagePathDir)</PackagePath>
|
230 | 76 | </TfmSpecificPackageFile>
|
231 | 77 | </ItemGroup>
|
232 | 78 | </Target>
|
233 | 79 |
|
234 |
| - <PropertyGroup> |
235 |
| - <SymbolTargetsToGetPdbs>GetIlmergeSymbolOutput;GetFinalBuildOutput</SymbolTargetsToGetPdbs> |
236 |
| - </PropertyGroup> |
237 | 80 | </Project>
|
0 commit comments