public static int Main(string[] args) { var options = new Options(); if (!ParseCommandLineOptions(args, options)) return 1; if (!Directory.Exists(options.OutputDir)) Directory.CreateDirectory(options.OutputDir); try { var compiler = new Compiler(options.Assembly, options.OutputDir); compiler.Process(); compiler.Compile(options.Assembly); } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); return 1; } return 0; }
public void GenAPI() { string genDirectory = Path.Combine("..", "..", "gen", "RPCGen.Tests.API"); Directory.CreateDirectory(genDirectory); var sourceDllPath = Path.GetFullPath("RPCGen.Tests.Services.dll"); var destDllPath = Path.Combine(genDirectory, "RPCGen.Tests.Services.dll"); var rpcCompiler = new Compiler(sourceDllPath, genDirectory); rpcCompiler.Process(); rpcCompiler.CompileApi(destDllPath); }
static void Main(string[] args) { var options = new Options(); if (!ParseCommandLineOptions(args, options)) return; if (!Directory.Exists(options.OutputDir)) Directory.CreateDirectory(options.OutputDir); Assembly assembly; if (!ParseAssembly(options.Assembly, out assembly)) return; var compiler = new Compiler(options, assembly); compiler.Process(); if(!string.IsNullOrEmpty(options.MSBuildProjectPath)){ MSBuildUpdater.UpdateMSBuild(options.MSBuildProjectPath,compiler.GeneratedFiles); } }