private object IndexAndReturnExitCode(IndexOptions opts) { if (opts.SourcePath.Length == 0 || opts.PdbFile.Length == 0) { return(1); } var ini = opts.IniPath ?? opts.ToolsPath; var arr = opts.BackEnd.Split(':'); var backEndType = arr[0].ToUpper(); var customCmd = arr.Length > 1 ? arr[1] : "git"; SettingsBean Params = new SettingsBean { PdbFile = opts.PdbFile, SourcePath = opts.SourcePath, ToolsPath = opts.ToolsPath, SrcSrvIniPath = ini, BackEndType = backEndType, CustomCommand = customCmd, LogLevel = opts.LogLevel, }; new SourceIndexer(Params).RunSourceIndexing(); return(0); }
private SourceIndexer CreateSourceIndexer() { SettingsBean Params = new SettingsBean { PdbFile = PdbPathTextBox.Text, SourcePath = SourceRootTextBox.Text, ToolsPath = SrcToolsPath.Text, SrcSrvIniPath = SrcSrvIniPath.Text, BackEndType = BackendComboBox.SelectedItem.ToString().ToUpper(), CustomCommand = customCommandText.Text }; return(new SourceIndexer(Params)); }
private object EvalAndReturnExitCode(EvalOptions opts) { SettingsBean Params = new SettingsBean { PdbFile = opts.PdbFile, ToolsPath = opts.ToolsPath, }; var indexer = new SourceIndexer(Params); string result = indexer.EvaluateSourceIndexing(); Console.Write(result); return(0); }
static public string ReadStream(SettingsBean Parameters, string streamName) { ProcessStartInfo info = new ProcessStartInfo { FileName = string.Format("\"{0}\\pdbstr.exe\"", Parameters.ToolsPath), Arguments = string.Format("-r -p:\"{0}\" -s:{1}", Parameters.PdbFile, streamName), UseShellExecute = false, RedirectStandardOutput = true }; Process process = Process.Start(info); string output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); return(output); }
static public string RunSrcTool(SettingsBean Parameters, string arguments) { ProcessStartInfo startInfo = new ProcessStartInfo { FileName = string.Format("\"{0}\\srctool.exe\"", Parameters.ToolsPath), Arguments = string.Format("\"{0}\" {1}", Parameters.PdbFile, arguments), RedirectStandardOutput = true, UseShellExecute = false }; var process = Process.Start(startInfo); var output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); return(output); }
static public void WriteStream(SettingsBean Parameters, string streamName, string streamContents) { var outFilePath = "SrcSrvOut.txt"; File.WriteAllText(outFilePath, streamContents); ProcessStartInfo info = new ProcessStartInfo { FileName = string.Format("\"{0}\\pdbstr.exe\"", Parameters.ToolsPath), Arguments = string.Format("-w -p:\"{0}\" -s:{1} -i:{2}", Parameters.PdbFile, streamName, outFilePath), UseShellExecute = false }; Process process = Process.Start(info); process.WaitForExit(); }
static public List <SourceFile> GetFileListing(SettingsBean Parameters) { var output = RunSrcTool(Parameters, "-r"); var lines = output.Split('\n'); // Copy all of the lines out. The last line is a newline and the one before that is a summary hence the -2. var results = new List <SourceFile>(); for (var i = 0; i < lines.Length - 2; ++i) { var file = new SourceFile() { PdbFilePath = lines[i].Trim() }; results.Add(file); } return(results); }
public SourceIndexer(SettingsBean Params) { Parameters = Params; LogWriter = new ConsoleLogger(); FrontEnd = new GitFrontEnd(); if (Parameters.BackEndType == "GIT") { BackEnd = new GitBackEnd(); } else if (Parameters.BackEndType == "GITHUB") { BackEnd = new GitHubBackEnd(); } else { // Default backend BackEnd = new CmdBackEnd(); } BackEnd.Parameters = Params; }
static public string GetUnindexedList(SettingsBean Parameters) { return(RunSrcTool(Parameters, "-u")); }
static public string GetSrcSrvResults(SettingsBean Parameters) { return(RunSrcTool(Parameters, "-n")); }
public virtual void SetParameters(SettingsBean Params) { Parameters = Params; }
public override void SetParameters(SettingsBean Params) { base.SetParameters(Params); FindRepositories(Params.SourcePath); }
static public void WriteStream(SettingsBean Parameters, string streamContents) { WriteStream(Parameters, "srcsrv", streamContents); }
static public string ReadStream(SettingsBean Parameters) { return(ReadStream(Parameters, "srcsrv")); }