diff options
| author | Rob Mensching <rob@firegiant.com> | 2022-07-06 10:21:17 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2022-07-06 11:22:41 -0700 |
| commit | a6d943fc8366ff8135d3a15960da4edaf10e0094 (patch) | |
| tree | 8ec452b7c0aa6bee7a6d71da19c7677e72b49bc8 | |
| parent | a3a3b2aca8978b9ff00d64a3be20ce6525ee78cd (diff) | |
| download | wix-a6d943fc8366ff8135d3a15960da4edaf10e0094.tar.gz wix-a6d943fc8366ff8135d3a15960da4edaf10e0094.tar.bz2 wix-a6d943fc8366ff8135d3a15960da4edaf10e0094.zip | |
Detect when Restore is required for a .wixproj to build
Closes 6701
| -rw-r--r-- | src/wix/WixToolset.Sdk/tools/wix.targets | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/wix/WixToolset.Sdk/tools/wix.targets b/src/wix/WixToolset.Sdk/tools/wix.targets index 247e0dd2..0e50ad0d 100644 --- a/src/wix/WixToolset.Sdk/tools/wix.targets +++ b/src/wix/WixToolset.Sdk/tools/wix.targets | |||
| @@ -215,6 +215,7 @@ | |||
| 215 | <ResolveReferencesDependsOn> | 215 | <ResolveReferencesDependsOn> |
| 216 | BeforeResolveReferences; | 216 | BeforeResolveReferences; |
| 217 | AssignProjectConfiguration; | 217 | AssignProjectConfiguration; |
| 218 | _ValidateProjectAssetsFile; | ||
| 218 | ResolveProjectReferences; | 219 | ResolveProjectReferences; |
| 219 | FindInvalidProjectReferences; | 220 | FindInvalidProjectReferences; |
| 220 | ResolveNativeProjectReferences; | 221 | ResolveNativeProjectReferences; |
| @@ -228,6 +229,27 @@ | |||
| 228 | 229 | ||
| 229 | <!-- | 230 | <!-- |
| 230 | ================================================================================================ | 231 | ================================================================================================ |
| 232 | _ValidateProjectAssetsFile | ||
| 233 | |||
| 234 | Ensures that the project assets file exists which indicates restore was completed. Restore is | ||
| 235 | required if there are any PackageReferences in the project. | ||
| 236 | |||
| 237 | [IN] | ||
| 238 | @(PackageReference) - Package references, if any. | ||
| 239 | $(ProjectAssetsFile) - Project assets file that should be created during restore. | ||
| 240 | ================================================================================================ | ||
| 241 | --> | ||
| 242 | <Target | ||
| 243 | Name="_ValidateProjectAssetsFile" | ||
| 244 | Condition=" '@(PackageReference)' != '' "> | ||
| 245 | |||
| 246 | <Error Text="The $(ProjectAssetsFile) file does not exist. Restore the project before trying to build again. Restore and build with "MSBuild -Restore" or "dotnet build"." | ||
| 247 | Condition="!Exists('$(ProjectAssetsFile)')" /> | ||
| 248 | |||
| 249 | </Target> | ||
| 250 | |||
| 251 | <!-- | ||
| 252 | ================================================================================================ | ||
| 231 | _WixUpdateProjectReferenceMetadata | 253 | _WixUpdateProjectReferenceMetadata |
| 232 | 254 | ||
| 233 | Updates project references so they build correctly when referenced by .wixproj. | 255 | Updates project references so they build correctly when referenced by .wixproj. |
| @@ -332,7 +354,7 @@ | |||
| 332 | <_ResolvedProjectReferencePaths Remove="@(WixLibrary)" /> | 354 | <_ResolvedProjectReferencePaths Remove="@(WixLibrary)" /> |
| 333 | </ItemGroup> | 355 | </ItemGroup> |
| 334 | 356 | ||
| 335 | <!-- Convert resolved project references into compiler defines and named and unamed bind paths--> | 357 | <!-- Convert resolved project references into compiler defines and named and unamed bind paths --> |
| 336 | <CreateProjectReferenceDefineConstantsAndBindPaths | 358 | <CreateProjectReferenceDefineConstantsAndBindPaths |
| 337 | ResolvedProjectReferences="@(_ResolvedProjectReferencePaths)" | 359 | ResolvedProjectReferences="@(_ResolvedProjectReferencePaths)" |
| 338 | ProjectConfigurations="$(VSProjectConfigurations)"> | 360 | ProjectConfigurations="$(VSProjectConfigurations)"> |
