public static int Run(string[] args) { DebugHelper.HandleDebugSwitch(ref args); try { var commandFactory = new DotNetCommandFactory(); var scriptRunner = new ScriptRunner(); var managedCompiler = new ManagedCompiler(scriptRunner, commandFactory); var nativeCompiler = new NativeCompiler(); var compilationDriver = new CompilationDriver(managedCompiler, nativeCompiler); var compilerCommandArgs = new CompilerCommandApp("dotnet compile", ".NET Compiler", "Compiler for the .NET Platform"); return compilerCommandArgs.Execute(compilationDriver.Compile, args); } catch (Exception ex) { #if DEBUG Console.Error.WriteLine(ex); #else Console.Error.WriteLine(ex.Message); #endif return 1; } }
public static int Run(string[] args) { DebugHelper.HandleDebugSwitch(ref args); try { var commandFactory = new DotNetCommandFactory(); var scriptRunner = new ScriptRunner(); var managedCompiler = new ManagedCompiler(scriptRunner, commandFactory); var nativeCompiler = new NativeCompiler(); var compilationDriver = new CompilationDriver(managedCompiler, nativeCompiler); var compilerCommandArgs = new CompilerCommandApp("dotnet compile", ".NET Compiler", "Compiler for the .NET Platform"); return(compilerCommandArgs.Execute(compilationDriver.Compile, args)); } catch (Exception ex) { #if DEBUG Console.Error.WriteLine(ex); #else Console.Error.WriteLine(ex.Message); #endif return(1); } }
protected override CompilationResult RunCompile(ProjectGraphNode projectNode) { try { var managedCompiler = new ManagedCompiler(_scriptRunner, _commandFactory); var success = managedCompiler.Compile(projectNode.ProjectContext, _args); return success ? CompilationResult.Success : CompilationResult.Failure; } finally { StampProjectWithSDKVersion(projectNode.ProjectContext); _incrementalManager.CacheIncrementalState(projectNode); } }