Skip to content

Commit 6e49edc

Browse files
authored
Add *.cache to excluded files when copying ref packages. (#1432)
* Add *.cache to excluded files when copying ref packages.
1 parent 1ae9cc7 commit 6e49edc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/CopyReferenceOnlyPackages.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ namespace Microsoft.DotNet.SourceBuild.Tasks
2121
public class CopyReferenceOnlyPackages : Task
2222
{
2323
private static readonly string[] extensionsToExclude = { ".exe", ".dylib", ".so", ".profdata", ".pgd", ".a" };
24+
private static readonly string[] extensionsToRemove = { ".cache" };
2425
private static readonly string[] pathsToExclude = { "testdata" };
2526
private static readonly string refPath = string.Concat(Path.DirectorySeparatorChar, "ref", Path.DirectorySeparatorChar);
2627

@@ -91,7 +92,11 @@ public override bool Execute()
9192
{
9293
foreach (var file in EnumerateAllFiles(dir, "*"))
9394
{
94-
if (file.EndsWith(".nupkg"))
95+
if (extensionsToRemove.Contains(Path.GetExtension(file)))
96+
{
97+
// skip these files
98+
}
99+
else if (file.EndsWith(".nupkg"))
95100
{
96101
File.Copy(file, Path.Combine(IdentifiedPackagesDir, Path.GetFileName(file)), true);
97102
}

0 commit comments

Comments
 (0)