Imported Upstream version 5.8.0.22

Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-10-19 20:04:20 +00:00
parent 5f4a27cc8a
commit 7d05485754
5020 changed files with 114082 additions and 186061 deletions

View File

@@ -0,0 +1,45 @@
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
namespace ILLink.Tasks
{
public class ComputeRemovedAssemblies : Task
{
/// <summary>
/// The paths to the inputs to the linker.
/// </summary>
[Required]
public ITaskItem[] InputAssemblies { get; set; }
/// <summary>
/// The paths to the linked assemblies.
/// </summary>
[Required]
public ITaskItem[] KeptAssemblies { get; set; }
/// <summary>
/// The set of assemblies in the inputs that weren't kept by
/// the linker. These items include the full metadata from
/// the input assemblies, and only the filenames of the
/// inputs are used to determine which assemblies were
/// removed.
/// </summary>
[Output]
public ITaskItem[] RemovedAssemblies { get; set; }
public override bool Execute()
{
var keptAssemblyNames = new HashSet<string> (
KeptAssemblies.Select(i => Path.GetFileName(i.ItemSpec))
);
RemovedAssemblies = InputAssemblies.Where(i =>
!keptAssemblyNames.Contains(Path.GetFileName(i.ItemSpec))
).ToArray();
return true;
}
}
}