You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
47
external/linker/corebuild/integration/ILLink.Tasks/ComputeManagedAssemblies.cs
vendored
Normal file
47
external/linker/corebuild/integration/ILLink.Tasks/ComputeManagedAssemblies.cs
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
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)
|
||||
|
||||
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) {
|
||||
try {
|
||||
AssemblyName.GetAssemblyName(f.ItemSpec);
|
||||
managedAssemblies.Add(f);
|
||||
} catch (BadImageFormatException) {
|
||||
}
|
||||
}
|
||||
ManagedAssemblies = managedAssemblies.ToArray();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user