You've already forked linux-packaging-mono
Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
This commit is contained in:
parent
5f4a27cc8a
commit
7d05485754
45
external/linker/corebuild/integration/ILLink.Tasks/ComputeRemovedAssemblies.cs
vendored
Normal file
45
external/linker/corebuild/integration/ILLink.Tasks/ComputeRemovedAssemblies.cs
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user