int GenPinvokeTable(String[] args) { var modules = new Dictionary <string, string> (); foreach (var module in args[1].Split(',')) { modules [module] = module; } args = args.Skip(2).ToArray(); #if NETFRAMEWORK var assemblies = new List <AssemblyDefinition> (); foreach (var fname in args) { assemblies.Add(AssemblyDefinition.ReadAssembly(fname)); } var generator = new PInvokeTableGenerator(); generator.Run(assemblies, modules); #else var generator = new PInvokeTableGenerator(); generator.OutputPath = Path.GetTempFileName(); generator.GenPInvokeTable(modules.Keys.ToArray(), args.ToArray()); Console.WriteLine(File.ReadAllText(generator.OutputPath)); #endif return(0); }
int GenPinvokeTable(String[] args) { var modules = new Dictionary <string, string> (); foreach (var module in args[2].Split(',')) { modules [module] = module; } var files = args.Skip(3).ToArray(); #if NETFRAMEWORK throw new NotSupportedException($"pinvoke generation is not supported for netstandard2.0"); #else var generator = new PInvokeTableGenerator(); Console.WriteLine($"Generating to {args[1]}"); generator.OutputPath = args[1]; generator.GenPInvokeTable(modules.Keys.ToArray(), files.ToArray()); #endif return(0); }