Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
RainOrigami committed Aug 14, 2023
1 parent 1fdd7d2 commit 4eb215c
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions BattleBitAPIRunner/ModuleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<PortableExecutableReference> 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<Type> 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();
//}


}
}

0 comments on commit 4eb215c

Please sign in to comment.