@ -1,3 +1,6 @@ | |||
[submodule "Doorstop"] | |||
path = Doorstop | |||
url = https://github.com/nike4613/UnityDoorstop-BSIPA | |||
[submodule "BuildTools"] | |||
path = BuildTools | |||
url = https://github.com/nike4613/BS-Plugin-BuildTools.git |
@ -1,6 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<configuration> | |||
<startup> | |||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | |||
</startup> | |||
</configuration> |
@ -1,71 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |||
<PropertyGroup> | |||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||
<ProjectGuid>{5F33B310-DC8D-4C0D-877E-BAC3908DE10F}</ProjectGuid> | |||
<OutputType>Exe</OutputType> | |||
<RootNamespace>CollectDependencies</RootNamespace> | |||
<AssemblyName>CollectDependencies</AssemblyName> | |||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | |||
<FileAlignment>512</FileAlignment> | |||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> | |||
<Deterministic>true</Deterministic> | |||
</PropertyGroup> | |||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
<PlatformTarget>AnyCPU</PlatformTarget> | |||
<DebugSymbols>true</DebugSymbols> | |||
<DebugType>full</DebugType> | |||
<Optimize>false</Optimize> | |||
<OutputPath>bin\Debug\</OutputPath> | |||
<DefineConstants>DEBUG;TRACE</DefineConstants> | |||
<ErrorReport>prompt</ErrorReport> | |||
<WarningLevel>4</WarningLevel> | |||
</PropertyGroup> | |||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||
<PlatformTarget>AnyCPU</PlatformTarget> | |||
<DebugType>pdbonly</DebugType> | |||
<Optimize>true</Optimize> | |||
<OutputPath>bin\Release\</OutputPath> | |||
<DefineConstants>TRACE</DefineConstants> | |||
<ErrorReport>prompt</ErrorReport> | |||
<WarningLevel>4</WarningLevel> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Mono.Cecil.Mdb, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.Mdb.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Mono.Cecil.Pdb, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.Pdb.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Mono.Cecil.Rocks, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.Rocks.dll</HintPath> | |||
</Reference> | |||
<Reference Include="System" /> | |||
<Reference Include="System.Core" /> | |||
<Reference Include="System.Xml.Linq" /> | |||
<Reference Include="System.Data.DataSetExtensions" /> | |||
<Reference Include="Microsoft.CSharp" /> | |||
<Reference Include="System.Data" /> | |||
<Reference Include="System.Net.Http" /> | |||
<Reference Include="System.Xml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="Program.cs" /> | |||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||
<Compile Include="Virtualizer.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<None Include="App.config" /> | |||
<None Include="packages.config" /> | |||
</ItemGroup> | |||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||
<Target Name="AfterBuild"> | |||
<Exec Command=""$(SolutionDir)$(AssemblyName)\$(OutputPath)$(AssemblyName).exe" Refs/refs.txt" WorkingDirectory="$(SolutionDir)"> | |||
</Exec> | |||
</Target> | |||
</Project> |
@ -1,135 +0,0 @@ | |||
using Mono.Cecil; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.IO; | |||
using System.Linq; | |||
namespace CollectDependencies | |||
{ | |||
static class Program | |||
{ | |||
static void Main(string[] args) | |||
{ | |||
var depsFile = File.ReadAllText(args[0]); | |||
var directoryName = Path.GetDirectoryName(args[0]); | |||
var files = new List<Tuple<string, int>>(); | |||
{ // Create files from stuff in depsfile | |||
var stack = new Stack<string>(); | |||
void Push(string val) | |||
{ | |||
string pre = ""; | |||
if (stack.Count > 0) | |||
pre = stack.First(); | |||
stack.Push(pre + val); | |||
} | |||
string Pop() => stack.Pop(); | |||
string Replace(string val) | |||
{ | |||
var v2 = Pop(); | |||
Push(val); | |||
return v2; | |||
} | |||
var lineNo = 0; | |||
foreach (var line in depsFile.Split(new[] { Environment.NewLine, "\n" }, StringSplitOptions.None)) | |||
{ | |||
var parts = line.Split('"'); | |||
var path = parts.Last(); | |||
var level = parts.Length - 1; | |||
if (path.StartsWith("::")) | |||
{ // pseudo-command | |||
parts = path.Split(' '); | |||
var command = parts[0].Substring(2); | |||
parts = parts.Skip(1).ToArray(); | |||
var arglist = string.Join(" ", parts); | |||
if (command == "from") | |||
{ // an "import" type command | |||
path = File.ReadAllText(Path.Combine(directoryName ?? throw new InvalidOperationException(), arglist)); | |||
} | |||
else if (command == "prompt") | |||
{ | |||
Console.Write(arglist); | |||
path = Console.ReadLine(); | |||
} | |||
else | |||
{ | |||
path = ""; | |||
Console.Error.WriteLine($"Invalid command {command}"); | |||
} | |||
} | |||
if (level > stack.Count - 1) | |||
Push(path); | |||
else if (level == stack.Count - 1) | |||
files.Add(new Tuple<string, int>(Replace(path), lineNo)); | |||
else if (level < stack.Count - 1) | |||
{ | |||
files.Add(new Tuple<string, int>(Pop(), lineNo)); | |||
while (level < stack.Count) | |||
Pop(); | |||
Push(path); | |||
} | |||
lineNo++; | |||
} | |||
files.Add(new Tuple<string, int>(Pop(), lineNo)); | |||
} | |||
foreach (var file in files) | |||
{ | |||
try | |||
{ | |||
var fparts = file.Item1.Split('?'); | |||
var fname = fparts[0]; | |||
if (fname == "") continue; | |||
var outp = Path.Combine(directoryName ?? throw new InvalidOperationException(), | |||
Path.GetFileName(fname) ?? throw new InvalidOperationException()); | |||
Console.WriteLine($"Copying \"{fname}\" to \"{outp}\""); | |||
if (File.Exists(outp)) File.Delete(outp); | |||
if (Path.GetExtension(fname)?.ToLower() == ".dll") | |||
{ | |||
// ReSharper disable once StringLiteralTypo | |||
if (fparts.Length > 1 && fparts[1] == "virt") | |||
{ | |||
var module = VirtualizedModule.Load(fname); | |||
module.Virtualize(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName(), | |||
Path.GetFileName(fname) ?? throw new InvalidOperationException())); | |||
} | |||
var modl = ModuleDefinition.ReadModule(fparts[0]); | |||
foreach (var t in modl.Types) | |||
{ | |||
foreach (var m in t.Methods) | |||
{ | |||
if (m.Body != null) | |||
{ | |||
m.Body.Instructions.Clear(); | |||
m.Body.InitLocals = false; | |||
m.Body.Variables.Clear(); | |||
} | |||
} | |||
} | |||
modl.Write(outp); | |||
} | |||
else | |||
{ | |||
File.Copy(fname, outp); | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
Console.WriteLine($"{Path.Combine(Environment.CurrentDirectory, args[0])}({file.Item2}): error: {e}"); | |||
} | |||
} | |||
} | |||
} | |||
} |
@ -1,35 +0,0 @@ | |||
using System.Reflection; | |||
using System.Runtime.InteropServices; | |||
// General Information about an assembly is controlled through the following | |||
// set of attributes. Change these attribute values to modify the information | |||
// associated with an assembly. | |||
[assembly: AssemblyTitle("CollectDependencies")] | |||
[assembly: AssemblyDescription("")] | |||
[assembly: AssemblyConfiguration("")] | |||
[assembly: AssemblyCompany("")] | |||
[assembly: AssemblyProduct("CollectDependencies")] | |||
[assembly: AssemblyCopyright("Copyright © 2018")] | |||
[assembly: AssemblyTrademark("")] | |||
[assembly: AssemblyCulture("")] | |||
// Setting ComVisible to false makes the types in this assembly not visible | |||
// to COM components. If you need to access a type in this assembly from | |||
// COM, set the ComVisible attribute to true on that type. | |||
[assembly: ComVisible(false)] | |||
// The following GUID is for the ID of the typelib if this project is exposed to COM | |||
[assembly: Guid("5f33b310-dc8d-4c0d-877e-bac3908de10f")] | |||
// Version information for an assembly consists of the following four values: | |||
// | |||
// Major Version | |||
// Minor Version | |||
// Build Number | |||
// Revision | |||
// | |||
// You can specify all the values or you can default the Build and Revision Numbers | |||
// by using the '*' as shown below: | |||
// [assembly: AssemblyVersion("1.0.*")] | |||
[assembly: AssemblyVersion("1.0.0.0")] | |||
[assembly: AssemblyFileVersion("1.0.0.0")] |
@ -1,111 +0,0 @@ | |||
using Mono.Cecil; | |||
using System.IO; | |||
using System.Linq; | |||
namespace CollectDependencies | |||
{ | |||
class VirtualizedModule | |||
{ | |||
private readonly FileInfo _file; | |||
private ModuleDefinition _module; | |||
public static VirtualizedModule Load(string engineFile) | |||
{ | |||
return new VirtualizedModule(engineFile); | |||
} | |||
private VirtualizedModule(string assemblyFile) | |||
{ | |||
_file = new FileInfo(assemblyFile); | |||
LoadModules(); | |||
} | |||
private void LoadModules() | |||
{ | |||
var resolver = new DefaultAssemblyResolver(); | |||
resolver.AddSearchDirectory(_file.DirectoryName); | |||
var parameters = new ReaderParameters | |||
{ | |||
AssemblyResolver = resolver, | |||
}; | |||
_module = ModuleDefinition.ReadModule(_file.FullName, parameters); | |||
} | |||
/// <summary> | |||
/// | |||
/// </summary> | |||
/// <param name="targetFile"></param> | |||
public void Virtualize(string targetFile) | |||
{ | |||
foreach (var type in _module.Types) | |||
{ | |||
VirtualizeType(type); | |||
} | |||
_module.Write(targetFile); | |||
} | |||
private void VirtualizeType(TypeDefinition type) | |||
{ | |||
if(type.IsSealed) | |||
{ | |||
// Unseal | |||
type.IsSealed = false; | |||
} | |||
if (type.IsInterface) return; | |||
if (type.IsAbstract) return; | |||
// These two don't seem to work. | |||
if (type.Name == "SceneControl" || type.Name == "ConfigUI") return; | |||
// Take care of sub types | |||
foreach (var subType in type.NestedTypes) | |||
{ | |||
VirtualizeType(subType); | |||
} | |||
foreach (var method in type.Methods) | |||
{ | |||
if (method.IsManaged | |||
&& method.IsIL | |||
&& !method.IsStatic | |||
&& !method.IsVirtual | |||
&& !method.IsAbstract | |||
&& !method.IsAddOn | |||
&& !method.IsConstructor | |||
&& !method.IsSpecialName | |||
&& !method.IsGenericInstance | |||
&& !method.HasOverrides) | |||
{ | |||
method.IsVirtual = true; | |||
method.IsPublic = true; | |||
method.IsPrivate = false; | |||
method.IsNewSlot = true; | |||
method.IsHideBySig = true; | |||
} | |||
} | |||
foreach (var field in type.Fields) | |||
{ | |||
if (field.IsPrivate) field.IsFamily = true; | |||
} | |||
} | |||
public bool IsVirtualized | |||
{ | |||
get | |||
{ | |||
var awakeMethods = _module.GetTypes().SelectMany(t => t.Methods.Where(m => m.Name == "Awake")); | |||
var methodDefinitions = awakeMethods as MethodDefinition[] ?? awakeMethods.ToArray(); | |||
if (!methodDefinitions.Any()) return false; | |||
return ((float)methodDefinitions.Count(m => m.IsVirtual) / methodDefinitions.Count()) > 0.5f; | |||
} | |||
} | |||
} | |||
} |
@ -1,4 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<packages> | |||
<package id="Mono.Cecil" version="0.10.3" targetFramework="net472" /> | |||
</packages> |
@ -1,73 +0,0 @@ | |||
using Microsoft.Build.Framework; | |||
using Microsoft.Build.Utilities; | |||
using Mono.Cecil; | |||
using System; | |||
using System.IO; | |||
namespace MSBuildTasks | |||
{ | |||
public class AssemblyRename : Task | |||
{ | |||
[Required] | |||
// ReSharper disable once UnusedAutoPropertyAccessor.Global | |||
public ITaskItem[] Assemblies { get; set; } | |||
public override bool Execute() | |||
{ | |||
foreach (ITaskItem assembly in Assemblies) | |||
{ | |||
// ItemSpec holds the filename or path of an Item | |||
if (assembly.ItemSpec.Length > 0) | |||
{ | |||
if (!File.Exists(assembly.ItemSpec)) | |||
{ | |||
Log.LogMessage(MessageImportance.Normal, "No file at " + assembly.ItemSpec); | |||
continue; | |||
} | |||
if (Path.GetExtension(assembly.ItemSpec) != ".dll") | |||
{ | |||
Log.LogMessage(MessageImportance.Normal, assembly.ItemSpec + " not a DLL"); | |||
continue; | |||
} | |||
try | |||
{ | |||
Log.LogMessage(MessageImportance.Normal, "Reading " + assembly.ItemSpec); | |||
var module = ModuleDefinition.ReadModule(assembly.ItemSpec); | |||
var asmName = module.Assembly.Name; | |||
var name = asmName.Name; | |||
var version = asmName.Version; | |||
var newFilen = $"{name}.{version}.dll"; | |||
var newFilePath = Path.Combine(Path.GetDirectoryName(assembly.ItemSpec) ?? throw new InvalidOperationException(), newFilen); | |||
module.Dispose(); | |||
Log.LogMessage(MessageImportance.Normal, $"Old file: {assembly.ItemSpec}, new file: {newFilePath}"); | |||
if (File.Exists(newFilePath)) | |||
File.Delete(newFilePath); | |||
Log.LogMessage(MessageImportance.Normal, "Moving"); | |||
try | |||
{ | |||
File.Move(assembly.ItemSpec, newFilePath); | |||
} | |||
catch (Exception) | |||
{ | |||
File.Copy(assembly.ItemSpec, newFilePath); | |||
File.Delete(assembly.ItemSpec); | |||
} | |||
} | |||
catch (Exception e) | |||
{ | |||
Log.LogErrorFromException(e); | |||
} | |||
} | |||
} | |||
return !Log.HasLoggedErrors; | |||
} | |||
} | |||
} |
@ -1,84 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |||
<PropertyGroup> | |||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||
<ProjectGuid>{F08C3C7A-3221-432E-BAB8-32BCE58408C8}</ProjectGuid> | |||
<OutputType>Library</OutputType> | |||
<AppDesignerFolder>Properties</AppDesignerFolder> | |||
<RootNamespace>MSBuildTasks</RootNamespace> | |||
<AssemblyName>MSBuildTasks</AssemblyName> | |||
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> | |||
<FileAlignment>512</FileAlignment> | |||
<TargetFrameworkProfile /> | |||
</PropertyGroup> | |||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
<DebugSymbols>true</DebugSymbols> | |||
<DebugType>full</DebugType> | |||
<Optimize>false</Optimize> | |||
<OutputPath>bin\Debug\</OutputPath> | |||
<DefineConstants>DEBUG;TRACE</DefineConstants> | |||
<ErrorReport>prompt</ErrorReport> | |||
<WarningLevel>4</WarningLevel> | |||
</PropertyGroup> | |||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||
<DebugType>pdbonly</DebugType> | |||
<Optimize>true</Optimize> | |||
<OutputPath>bin\Release\</OutputPath> | |||
<DefineConstants>TRACE</DefineConstants> | |||
<ErrorReport>prompt</ErrorReport> | |||
<WarningLevel>4</WarningLevel> | |||
<UseVSHostingProcess>true</UseVSHostingProcess> | |||
</PropertyGroup> | |||
<ItemGroup> | |||
<Reference Include="Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.Build.Framework.15.9.20\lib\net46\Microsoft.Build.Framework.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.Build.Utilities.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.Build.Utilities.Core.15.9.20\lib\net46\Microsoft.Build.Utilities.Core.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.16.30\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath> | |||
<EmbedInteropTypes>True</EmbedInteropTypes> | |||
</Reference> | |||
<Reference Include="Mono.Cecil, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Mono.Cecil.Mdb, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.Mdb.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Mono.Cecil.Pdb, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.Pdb.dll</HintPath> | |||
</Reference> | |||
<Reference Include="Mono.Cecil.Rocks, Version=0.10.3.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\Mono.Cecil.0.10.3\lib\net40\Mono.Cecil.Rocks.dll</HintPath> | |||
</Reference> | |||
<Reference Include="System" /> | |||
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard1.3\System.Collections.Immutable.dll</HintPath> | |||
</Reference> | |||
<Reference Include="System.Configuration" /> | |||
<Reference Include="System.Core" /> | |||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | |||
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath> | |||
<Private>True</Private> | |||
</Reference> | |||
<Reference Include="System.Xaml" /> | |||
<Reference Include="System.Xml.Linq" /> | |||
<Reference Include="System.Data.DataSetExtensions" /> | |||
<Reference Include="Microsoft.CSharp" /> | |||
<Reference Include="System.Data" /> | |||
<Reference Include="System.Net.Http" /> | |||
<Reference Include="System.Xml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Compile Include="AssemblyRenameTask.cs" /> | |||
<Compile Include="Pdb2Mdb.cs" /> | |||
<Compile Include="Properties\AssemblyInfo.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<None Include="packages.config" /> | |||
</ItemGroup> | |||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||
</Project> |
@ -1,79 +0,0 @@ | |||
using System; | |||
using System.IO; | |||
using Microsoft.Build.Framework; | |||
using Microsoft.Build.Utilities; | |||
namespace MSBuildTasks | |||
{ | |||
public class PdbToMdb : Task | |||
{ | |||
[Required] | |||
// ReSharper disable once UnusedAutoPropertyAccessor.Global | |||
public ITaskItem[] Binaries { get; set; } | |||
public override bool Execute() | |||
{ | |||
//var readerProvider = new PdbReaderProvider(); | |||
//var writerProvider = new MdbWriterProvider(); | |||
foreach (ITaskItem dll in Binaries) | |||
{ | |||
// ItemSpec holds the filename or path of an Item | |||
if (dll.ItemSpec.Length > 0) | |||
{ | |||
if (!File.Exists(dll.ItemSpec)) | |||
{ | |||
Log.LogMessage(MessageImportance.Normal, "No file at " + dll.ItemSpec); | |||
continue; | |||
} | |||
if (Path.GetExtension(dll.ItemSpec) != ".dll" && Path.GetExtension(dll.ItemSpec) != ".pdb") | |||
{ | |||
Log.LogMessage(MessageImportance.Normal, dll.ItemSpec + " not a DLL or PDB"); | |||
continue; | |||
} | |||
try | |||
{ | |||
/*Log.LogMessage(MessageImportance.Normal, "Processing PDB for " + dll.ItemSpec); | |||
var path = Path.ChangeExtension(dll.ItemSpec, ".dll"); | |||
var module = ModuleDefinition.ReadModule(path); | |||
var reader = readerProvider.GetSymbolReader(module, path); | |||
var writer = writerProvider.GetSymbolWriter(module, path); | |||
foreach (var type in module.Types) | |||
foreach (var method in type.Methods) | |||
{ | |||
var read = reader.Read(method); | |||
if (read == null) Log.LogWarning($"Method {module.FileName} -> {method.FullName} read from PDB as null"); | |||
else writer.Write(read); | |||
} | |||
writer.Dispose(); | |||
reader.Dispose(); | |||
module.Dispose();*/ | |||
var path = Path.ChangeExtension(dll.ItemSpec, ".dll"); | |||
Log.LogMessage(MessageImportance.Normal, "Processing PDB for " + path); | |||
/*Process.Start(new ProcessStartInfo | |||
{ | |||
WorkingDirectory = Path.GetDirectoryName(path) ?? throw new InvalidOperationException(), | |||
FileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase) ?? throw new InvalidOperationException(), "pdb2mdb.exe"), | |||
Arguments = Path.GetFileName(path) | |||
});*/ | |||
//Pdb2Mdb.Converter.Convert(path); | |||
} | |||
catch (Exception e) | |||
{ | |||
Log.LogErrorFromException(e); | |||
Log.LogError(e.ToString()); | |||
} | |||
} | |||
} | |||
return !Log.HasLoggedErrors; | |||
} | |||
} | |||
} |
@ -1,35 +0,0 @@ | |||
using System.Reflection; | |||
using System.Runtime.InteropServices; | |||
// General Information about an assembly is controlled through the following | |||
// set of attributes. Change these attribute values to modify the information | |||
// associated with an assembly. | |||
[assembly: AssemblyTitle("MSBuildTasks")] | |||
[assembly: AssemblyDescription("")] | |||
[assembly: AssemblyConfiguration("")] | |||
[assembly: AssemblyCompany("")] | |||
[assembly: AssemblyProduct("MSBuildTasks")] | |||
[assembly: AssemblyCopyright("Copyright © 2018")] | |||
[assembly: AssemblyTrademark("")] | |||
[assembly: AssemblyCulture("")] | |||
// Setting ComVisible to false makes the types in this assembly not visible | |||
// to COM components. If you need to access a type in this assembly from | |||
// COM, set the ComVisible attribute to true on that type. | |||
[assembly: ComVisible(false)] | |||
// The following GUID is for the ID of the typelib if this project is exposed to COM | |||
[assembly: Guid("f08c3c7a-3221-432e-bab8-32bce58408c8")] | |||
// Version information for an assembly consists of the following four values: | |||
// | |||
// Major Version | |||
// Minor Version | |||
// Build Number | |||
// Revision | |||
// | |||
// You can specify all the values or you can default the Build and Revision Numbers | |||
// by using the '*' as shown below: | |||
// [assembly: AssemblyVersion("1.0.*")] | |||
[assembly: AssemblyVersion("1.0.0.0")] | |||
[assembly: AssemblyFileVersion("1.0.0.0")] |
@ -1,9 +0,0 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<packages> | |||
<package id="Microsoft.Build.Framework" version="15.9.20" targetFramework="net46" /> | |||
<package id="Microsoft.Build.Utilities.Core" version="15.9.20" targetFramework="net46" /> | |||
<package id="Microsoft.VisualStudio.Setup.Configuration.Interop" version="1.16.30" targetFramework="net46" developmentDependency="true" /> | |||
<package id="Mono.Cecil" version="0.10.3" targetFramework="net46" /> | |||
<package id="System.Collections.Immutable" version="1.5.0" targetFramework="net46" /> | |||
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="net46" /> | |||
</packages> |