@@ -51,8 +51,11 @@ Copyright (c) .NET Foundation. All rights reserved.
51
51
<ArtifactsBinOutputName Condition =" '$(ArtifactsBinOutputName)' == ''" >bin</ArtifactsBinOutputName >
52
52
<ArtifactsPublishOutputName Condition =" '$(ArtifactsPublishOutputName)' == ''" >publish</ArtifactsPublishOutputName >
53
53
<ArtifactsPackageOutputName Condition =" '$(ArtifactsPackageOutputName)' == ''" >package</ArtifactsPackageOutputName >
54
- <!-- When using artifacts output, we need to track file writes with a bit more knowledge than the MSBuild Common targets have-->
55
- <IncrementalCleanDependsOn >$(IncrementalCleanDependsOn);_TrackFileWritesShareableUnderArtifactsPath</IncrementalCleanDependsOn >
54
+ <!-- By default MSBuild won't allow tracking/automatic clean-up of files that are outside of a Project's child directory structure.
55
+ This flag opts us into a mode where the Common targets will track and clean such files, which is good because
56
+ in Artifacts layout virtually all transitive and package references are such files.
57
+ See https://github.com/dotnet/msbuild/pull/12096 for full details. -->
58
+ <TrackFileWritesShareableOutsideOfProjectDirectory >true</TrackFileWritesShareableOutsideOfProjectDirectory >
56
59
</PropertyGroup >
57
60
58
61
<PropertyGroup Condition =" '$(UseArtifactsOutput)' == 'true' And '$(ArtifactsPivots)' == ''" >
@@ -163,25 +166,4 @@ Copyright (c) .NET Foundation. All rights reserved.
163
166
164
167
</Target >
165
168
166
-
167
- <!-- Addresses a gap in the _CleanGetCurrentAndPriorFileWrites:
168
- https://github.com/dotnet/msbuild/blob/25d1e4c409f9efd81c345fb41fbee6d2af83bed6/src/Tasks/Microsoft.Common.CurrentVersion.targets#L5765-L5777
169
-
170
- This Target won't remove FileWritesShareable if they aren't under the Project's own directory,
171
- but in Artifacts layout that will never be the case. So we allow finding the FileWritesShareable under our output
172
- paths as well -->
173
- <Target Name =" _TrackFileWritesShareableUnderArtifactsPath" >
174
- <FindUnderPath Path =" $(OutputPath)" Files =" @(FileWritesShareable)" UpdateToAbsolutePaths =" true" >
175
- <Output TaskParameter =" InPath" ItemName =" _LocatedFileWritesShareable" />
176
- </FindUnderPath >
177
- <FindUnderPath Path =" $(IntermediateOutputPath)" Files =" @(FileWritesShareable)" UpdateToAbsolutePaths =" true" >
178
- <Output TaskParameter =" InPath" ItemName =" _LocatedFileWritesShareable" />
179
- </FindUnderPath >
180
-
181
- <!-- Remove duplicates from files produced in this build. -->
182
- <RemoveDuplicates Inputs =" @(_LocatedFileWritesShareable)" >
183
- <Output TaskParameter =" Filtered" ItemName =" _CleanCurrentFileWrites" />
184
- </RemoveDuplicates >
185
- </Target >
186
-
187
169
</Project >
0 commit comments