コード例 #1
0
        public BindingConfiguration GetConfiguration()
        {
            var project = legacySerializer.ReadSolutionBinding();

            if (project != null)
            {
                return(BindingConfiguration.CreateBoundConfiguration(project, isLegacy: true));
            }

            return(wrappedProvider.GetConfiguration());
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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());
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
        private BindingConfiguration CreateBindingConfiguration(string bindingPath, BoundSonarQubeProject boundProject, SonarLintMode sonarLintMode)
        {
            var bindingConfigDirectory = Path.GetDirectoryName(bindingPath);

            return(BindingConfiguration.CreateBoundConfiguration(boundProject, sonarLintMode, bindingConfigDirectory));
        }