@@ -37,54 +37,8 @@ Copyright (c) .NET Foundation. All rights reserved.
3737 Similar to the property above, it must be set here.
3838 -->
3939 <UsingNETSdkDefaults >true</UsingNETSdkDefaults >
40- </PropertyGroup >
41-
42-
43-
44- <!-- We need to put the UseArtifactsOutput logic after the import of Directory.Build.props, but before the MSBuild Project Extensions .props import.
45- However, both of these things happen in Microsoft.Common.props with no opportunity to insert logic in between them.
46-
47- So what we do here is duplicate the Directory.Build.props import logic from Microsoft.Common.props, and then set ImportDirectoryBuildProps to
48- false so that it doesn't get imported twice.
49-
50- Alternatively, we could add a hook in MSBuild to define a file to import at the right location, to avoid duplicating the logic here.
51- -->
52- <PropertyGroup >
53- <ImportDirectoryBuildProps Condition =" '$(ImportDirectoryBuildProps)' == ''" >true</ImportDirectoryBuildProps >
54- </PropertyGroup >
55- <PropertyGroup Condition =" '$(ImportDirectoryBuildProps)' == 'true' and '$(DirectoryBuildPropsPath)' == ''" >
56- <_DirectoryBuildPropsFile Condition =" '$(_DirectoryBuildPropsFile)' == ''" >Directory.Build.props</_DirectoryBuildPropsFile >
57- <_DirectoryBuildPropsBasePath Condition =" '$(_DirectoryBuildPropsBasePath)' == ''" >$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), '$(_DirectoryBuildPropsFile)'))</_DirectoryBuildPropsBasePath >
58- <DirectoryBuildPropsPath Condition =" '$(_DirectoryBuildPropsBasePath)' != '' and '$(_DirectoryBuildPropsFile)' != ''" >$([System.IO.Path]::Combine('$(_DirectoryBuildPropsBasePath)', '$(_DirectoryBuildPropsFile)'))</DirectoryBuildPropsPath >
59- </PropertyGroup >
60-
61- <Import Project =" $(DirectoryBuildPropsPath)" Condition =" '$(ImportDirectoryBuildProps)' == 'true' and exists('$(DirectoryBuildPropsPath)')" />
62-
63- <PropertyGroup >
64- <ImportDirectoryBuildProps >false</ImportDirectoryBuildProps >
65- </PropertyGroup >
66-
67- <!-- If ArtifactsPath or UseArtifactsOutput are set, then import .props to set ArtifactsPath here, so that BaseIntermediateOutputPath can be
68- set in the ArtifactsPath.
69- If the .props file is not imported here, it will be imported from Microsoft.NET.DefaultOutputPaths.targets, so that artifacts output
70- properties can be set directly in the project file too (only in that case they won't affect the intermediate output). -->
71- <Import Project =" $(MSBuildThisFileDirectory)..\targets\Microsoft.NET.DefaultArtifactsPath.props"
72- Condition =" '$(UseArtifactsOutput)' == 'true' Or '$(ArtifactsPath)' != ''" />
73-
74- <PropertyGroup Condition =" '$(UseArtifactsOutput)' == 'true'" >
75- <UseArtifactsIntermediateOutput Condition =" '$(UseArtifactsIntermediateOutput)' == ''" >true</UseArtifactsIntermediateOutput >
76- <ArtifactsProjectName Condition =" '$(ArtifactsProjectName)' == ''" >$(MSBuildProjectName)</ArtifactsProjectName >
77- </PropertyGroup >
78-
79- <PropertyGroup Condition =" '$(UseArtifactsOutput)' == 'true' And '$(BaseIntermediateOutputPath)' == '' And '$(UseArtifactsIntermediateOutput)' == 'true'" >
80- <BaseIntermediateOutputPath Condition =" '$(IncludeProjectNameInArtifactsPaths)' == 'true'" >$(ArtifactsPath)\obj\$(ArtifactsProjectName)\</BaseIntermediateOutputPath >
81- <BaseIntermediateOutputPath Condition =" '$(BaseIntermediateOutputPath)' == ''" >$(ArtifactsPath)\obj\</BaseIntermediateOutputPath >
82- </PropertyGroup >
8340
84- <!-- Record whether ArtifactsPath / UseArtifactsOutput was set at this point in evaluation. We will generate an error if these properties are set
85- after this point (ie in the project file). -->
86- <PropertyGroup Condition =" '$(UseArtifactsOutput)' == 'true'" >
87- <_ArtifactsPathSetEarly >true</_ArtifactsPathSetEarly >
41+ <CustomAfterDirectoryBuildProps >$(CustomAfterDirectoryBuildProps);$(MSBuildThisFileDirectory)UseArtifactsOutputPath.props</CustomAfterDirectoryBuildProps >
8842 </PropertyGroup >
8943
9044 <PropertyGroup Condition =" '$(MSBuildProjectFullPath)' == '$(ProjectToOverrideProjectExtensionsPath)'" >
0 commit comments