Xamarin Public Jenkins (auto-signing) 5924117973 Imported Upstream version 5.4.0.199
Former-commit-id: f4d318e4b2f128fa9f4d31b37bb3839a3fc0dfb2
2017-09-25 16:57:44 +00:00

47 lines
1.1 KiB
C#

using System;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Linq;
using System.Reflection;
using System.Collections.Generic;
using Microsoft.Build.Utilities; // Task
using Microsoft.Build.Framework; // MessageImportance
using Microsoft.NET.Build.Tasks; // LockFileCache
using NuGet.ProjectModel; // LockFileTargetLibrary
using NuGet.Frameworks; // NuGetFramework.Parse(targetframework)
using Mono.Cecil;
namespace ILLink.Tasks
{
public class ComputeManagedAssemblies : Task
{
/// <summary>
/// Paths to assemblies.
/// </summary>
[Required]
public ITaskItem[] Assemblies { get; set; }
/// <summary>
/// This will contain the output list of managed
/// assemblies. Metadata from the input parameter
/// Assemblies is preserved.
/// </summary>
[Output]
public ITaskItem[] ManagedAssemblies { get; set; }
public override bool Execute()
{
var managedAssemblies = new List<ITaskItem>();
foreach (var f in Assemblies) {
if (Utils.IsManagedAssembly(f.ItemSpec)) {
managedAssemblies.Add(f);
}
}
ManagedAssemblies = managedAssemblies.ToArray();
return true;
}
}
}