Exemplo n.º 1
0
        private static HttpBasicAuthenticator GetAuthenticator(CmdOptions o)
        {
            if (!String.IsNullOrEmpty(o.SonarqubeToken))
            {
                return(new HttpBasicAuthenticator(o.SonarqubeToken, String.Empty));
            }

            return(new HttpBasicAuthenticator(o.SonarqubeUsername, o.SonarqubePassword));
        }
Exemplo n.º 2
0
        private static SonarConfigurator CreateConfigurator(CmdOptions o)
        {
            var client = new RestClient(o.SonarqubeHost);

            client.Authenticator = GetAuthenticator(o);

            SonarApi            sonarApi     = new SonarApi(client);
            SonarWriter         sonarWriter  = new SonarWriter(sonarApi);
            ConfigurationReader configReader = new ConfigurationReader();

            SonarConfigurator configurator = new SonarConfigurator(configReader, sonarWriter);

            return(configurator);
        }