public override void StartBuild() { BuildOptions options = new BuildOptions(BuildTarget.Rebuild, CallbackMethod); options.TargetForDependencies = BuildTarget.Build; options.ProjectAdditionalProperties["RunSourceAnalysis"] = "true"; options.ProjectAdditionalProperties["StyleCopFile"] = StyleCopWrapper.FindStyleCopPath() ?? string.Empty; BuildEngine.BuildInGui(this.ProjectToBuild, options); }
void ModifyStyleCopSettingsClick(object sender, EventArgs e) { var settingsFile = helper.GetProperty <string>("SourceAnalysisOverrideSettingsFile", "", true); if (settingsFile == StyleCopWrapper.GetMasterSettingsFile()) { if (ConfirmSwitchFromMaster()) { settingsFile = CopyFromMaster(); } } if (!System.IO.File.Exists(settingsFile)) { if (ConfirmReplaceMissingFile()) { settingsFile = CopyFromMaster(); } else { MessageService.ShowWarning("No settings file found to modify."); return; } } string styleCopPath = StyleCopWrapper.FindStyleCopPath(); string executable; if (styleCopPath != null) { executable = Path.Combine(styleCopPath, "StyleCopSettingsEditor.exe"); } else { executable = null; } string parameters = "\"" + settingsFile + "\""; if (!File.Exists(executable)) { LoggingService.Debug("StyleCopSettingsEditor.exe: " + executable); MessageService.ShowWarning("Unable to find the StyleCop Settings editor. Please specify the StyleCop location in Tools Options."); return; } using (Process p = Process.Start("\"" + executable + "\"", parameters)) { // No need to wait for the settings dialog to close - we can leave it open. } }
void ShowStatus() { string path = StyleCopWrapper.FindStyleCopPath(); if (path == null) { Get <Label>("status").Text = StringParser.Parse("StyleCop not found in the given path."); Get <Button>("ModifyStyleCopSettings").Enabled = false; } else { Get <Label>("status").Text = StringParser.Parse("StyleCop was found in: ") + Environment.NewLine + path; Get <Button>("ModifyStyleCopSettings").Enabled = true; } }
void ModifyStyleCopSettingsClick(object sender, EventArgs e) { var executable = Path.Combine(StyleCopWrapper.FindStyleCopPath(), "StyleCopSettingsEditor.exe"); var parameters = "\"" + StyleCopWrapper.GetMasterSettingsFile() + "\""; if (!File.Exists(executable)) { LoggingService.Debug("StyleCopSettingsEditor.exe: " + executable); MessageService.ShowWarning("Unable to find the StyleCop Settings editor. Please specify the StyleCop location in Tools Options."); return; } using (Process p = Process.Start("\"" + executable + "\"", parameters)) { // No need to wait for the settings dialog to close - we can leave it open. } }