From 4eb215ca90e85915573d92d54f3baa0b1b582ce2 Mon Sep 17 00:00:00 2001 From: Longoon12000 Date: Mon, 14 Aug 2023 22:53:47 +0200 Subject: [PATCH] Remove unused code --- BattleBitAPIRunner/ModuleProvider.cs | 66 ---------------------------- 1 file changed, 66 deletions(-) diff --git a/BattleBitAPIRunner/ModuleProvider.cs b/BattleBitAPIRunner/ModuleProvider.cs index 9b35141..63a554a 100644 --- a/BattleBitAPIRunner/ModuleProvider.cs +++ b/BattleBitAPIRunner/ModuleProvider.cs @@ -82,71 +82,5 @@ private static void compileProject(string csprojFilePath) Console.WriteLine("Done"); } - - //private void downloadNugetPackage(string packageName, string version) - //{ - // Process process = new Process(); - // process.StartInfo.FileName = "nuget.exe"; - // process.StartInfo.Arguments = $"install {packageName} -Version {version} -OutputDirectory {Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Libraries")}"; - // process.StartInfo.UseShellExecute = false; - // process.StartInfo.RedirectStandardOutput = true; - // process.Start(); - // string output = process.StandardOutput.ReadToEnd(); - // process.WaitForExit(); - // if (process.ExitCode != 0) - // { - // throw new Exception($"Failed to download nuget package {packageName} version {version}:{Environment.NewLine}{output}"); - // } - //} - - //private static Type compile(string code, string name) - //{ - - - - // //List refs = AppDomain.CurrentDomain.GetAssemblies().Where(x => !string.IsNullOrWhiteSpace(x.Location)).Select(x => MetadataReference.CreateFromFile(x.Location)).ToList(); - // //refs.Add(MetadataReference.CreateFromFile(typeof(BattleBitModule).Assembly.Location)); - // //refs.Add(MetadataReference.CreateFromFile(typeof(Console).Assembly.Location)); - - // //SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(code); - // //CSharpCompilation compilation = CSharpCompilation.Create(name) - // // .AddReferences(MetadataReference.CreateFromFile(typeof(object).Assembly.Location)) - // // .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) - // // .WithReferences(refs) - // // .AddSyntaxTrees(syntaxTree); - - // //Assembly? assembly = null; - - // //using (Stream codeStream = new MemoryStream()) - // //{ - // // EmitResult compilationResult = compilation.Emit(codeStream); - - // // if (!compilationResult.Success) - // // { - // // var sb = new StringBuilder(); - // // foreach (var diag in compilationResult.Diagnostics) - // // { - // // sb.AppendLine(diag.ToString()); - // // } - - // // throw new Exception(sb.ToString()); - // // } - - - // // assembly = Assembly.Load(((MemoryStream)codeStream).ToArray()); - // //} - - // //// Make sure there is exactly one type that inherits from BattleBitModule - // //IEnumerable moduleTypes = assembly.GetTypes().Where(x => x.IsSubclassOf(typeof(BattleBitModule))); - - // //if (moduleTypes.Count() != 1) - // //{ - // // throw new Exception($"Module {name} must have exactly one type that inherits from {nameof(BattleBitModule)}"); - // //} - - // //return moduleTypes.First(); - //} - - } }