/// <summary> /// Load and delegate parse and execution of build file. /// </summary> /// <param name="action">Action to peform in build file.</param> static void LoadBuild(string action) { string buildConf = null; try { TextReader input = new StreamReader(buildFile); buildConf = input.ReadToEnd(); // Shrink string, by replacing tabs with spaces; // Gaudi build files should be written using tabs buildConf = buildConf.Replace("\t", ""); } catch (IOException ioe) { // Catch I/O exception b.DisplayUsageError(ioe); } catch (Exception ex) { // Catch another exception b.DisplayUsageError(ex); } // Delegate to the foreman and builder GaudiForeman foreman = new GaudiForeman(buildConf); GaudiBuilder builder = new GaudiBuilder(null); }
/// <summary> /// Just perform a stdin command; really just for testing implemented commands. /// E.g. argument ":move a->b". /// </summary> /// <param name="cmd">Command to execute.</param> /// <param name="param">Parameter for command.</param> static void RunCommand(string cmd, string param) { // Create a new builder to run a command GaudiBuilder builder = new GaudiBuilder(); builder.DoCommand(cmd, param); Environment.Exit(0); }