public BindingConfiguration GetConfiguration() { var project = legacySerializer.ReadSolutionBinding(); if (project != null) { return(BindingConfiguration.CreateBoundConfiguration(project, isLegacy: true)); } return(wrappedProvider.GetConfiguration()); }
private BindingConfiguration TryGetBindingConfiguration(string bindingPath, SonarLintMode sonarLintMode) { if (bindingPath == null) { return(null); } var boundProject = solutionBindingSerializer.Read(bindingPath); return(boundProject == null ? null : BindingConfiguration.CreateBoundConfiguration(boundProject, sonarLintMode)); }
public BindingConfiguration GetConfiguration() { var project = legacySerializer.ReadSolutionBinding(); if (project != null) { var config = BindingConfiguration.CreateBoundConfiguration(project, isLegacy: true); // Make sure the new config has the same value wrappedProvider.WriteConfiguration(config); return(config); } return(wrappedProvider.GetConfiguration()); }
public BindingConfiguration GetConfiguration() { var project = legacySerializer.ReadSolutionBinding(); if (project != null) { return(BindingConfiguration.CreateBoundConfiguration(project, isLegacy: true)); } project = newConnectedModeSerializer.ReadSolutionBinding(); if (project != null) { return(BindingConfiguration.CreateBoundConfiguration(project, isLegacy: false)); } return(BindingConfiguration.Standalone); }
private BindingConfiguration TryGetBindingConfiguration(string bindingPath, SonarLintMode sonarLintMode) { if (bindingPath == null) { return(null); } var boundProject = solutionBindingDataReader.Read(bindingPath); if (boundProject == null) { return(null); } var bindingConfigDirectory = Path.GetDirectoryName(bindingPath); return(BindingConfiguration.CreateBoundConfiguration(boundProject, sonarLintMode, bindingConfigDirectory)); }
internal /* for testing */ void SaveBindingInfo(IProgressController controller, IProgressStepExecutionEvents notifications, CancellationToken token) { notifications.ProgressChanged(Strings.StartedSolutionBindingWorkflow); notifications.ProgressChanged(Strings.Bind_SavingBindingConfiguration); var connInfo = this.bindingArgs.Connection; BasicAuthCredentials credentials = connInfo.UserName == null ? null : new BasicAuthCredentials(connInfo.UserName, connInfo.Password); var boundProject = new BoundSonarQubeProject(connInfo.ServerUri, this.bindingArgs.ProjectKey, credentials, connInfo.Organization); var config = BindingConfiguration.CreateBoundConfiguration(boundProject, false); if (this.writer.WriteConfiguration(config)) { notifications.ProgressChanged(Strings.FinishedSolutionBindingWorkflowSuccessful); } else { this.host.Logger.WriteLine(Strings.Bind_FailedToSaveConfiguration); AbortWorkflow(controller, token); } }
private BindingConfiguration CreateBindingConfiguration(string bindingPath, BoundSonarQubeProject boundProject, SonarLintMode sonarLintMode) { var bindingConfigDirectory = Path.GetDirectoryName(bindingPath); return(BindingConfiguration.CreateBoundConfiguration(boundProject, sonarLintMode, bindingConfigDirectory)); }