tasks/sonar.js
function buildArgs(sonarOptions, data) {
            // Default arguments
            var args = [
                '-Dsonar.sources=src',
                '-Dsonar.tests=test',
                '-Dsonar.javascript.jstestdriver.reportsPath=results',
                '-Dsonar.genericcoverage.unitTestReportPaths=' + 'results' + path.sep + 'TESTS-junit.xml',
                '-Dsonar.javascript.jstestdriver.itReportsPath=results',
                '-Dsonar.javascript.lcov.reportPaths=' + 'results' + path.sep + 'coverage_report.lcov' + ',' + 'results' + path.sep + 'it_coverage_report.lcov',
                '-Dsonar.javascript.lcov.reportPath=' + 'results' + path.sep + 'coverage_report.lcov',
                '-Dsonar.javascript.lcov.itReportPath=' + 'results' + path.sep + 'it_coverage_report.lcov'
            ];

            // Add the parameter (-D) only when the 'key' exists in the 'object'
            function addParameter(prop, object, key) {
                var value = _.result(object, key);
                if (value !== undefined && value !== null && sonarOptions.excludedProperties.indexOf(prop) === -1) {
                    args.push('-D' + prop + '=' + value);
                }
            }

            addParameter('sonar.host.url', sonarOptions.instance, 'hostUrl');
            addParameter('sonar.jdbc.url', sonarOptions.instance, 'jdbcUrl');
            addParameter('sonar.jdbc.username', sonarOptions.instance, 'jdbcUsername');
            addParameter('sonar.jdbc.password', sonarOptions.instance, 'jdbcPassword');
            addParameter('sonar.login', sonarOptions.instance, 'login');
            addParameter('sonar.password', sonarOptions.instance, 'password');

            addParameter('sonar.sourceEncoding', sonarOptions, 'sourceEncoding');
            addParameter('sonar.language', sonarOptions, 'language');
            addParameter('sonar.dynamicAnalysis', sonarOptions, 'dynamicAnalysis');
            addParameter('sonar.projectBaseDir', sonarOptions, 'defaultOutputDir');
            addParameter('sonar.scm.disabled', sonarOptions, 'scmDisabled');

            addParameter('sonar.projectKey', data.project, 'key');
            addParameter('sonar.projectName', data.project, 'name');
            addParameter('sonar.projectVersion', data.project, 'version');

            addParameter('sonar.exclusions', data, 'exclusions');
            return args;
        }
function buildArgs(sonarOptions, data) {
            // Default arguments
            var args = [
                '-Dsonar.sources=src',
                '-Dsonar.tests=test',
                '-Dsonar.javascript.jstestdriver.reportsPath=results',
                '-Dsonar.genericcoverage.unitTestReportPaths=' + 'results' + path.sep + 'TESTS-junit.xml',
                '-Dsonar.javascript.jstestdriver.itReportsPath=results',
                '-Dsonar.javascript.lcov.reportPaths=' + 'results' + path.sep + 'coverage_report.lcov' + ',' + 'results' + path.sep + 'it_coverage_report.lcov',
                '-Dsonar.javascript.lcov.reportPath=' + 'results' + path.sep + 'coverage_report.lcov',
                '-Dsonar.javascript.lcov.itReportPath=' + 'results' + path.sep + 'it_coverage_report.lcov'
            ];

            // Add the parameter (-D) only when the 'key' exists in the 'object'
            function addParameter(prop, object, key) {
                var value = _.result(object, key);
                if (value !== undefined && value !== null && sonarOptions.excludedProperties.indexOf(prop) === -1) {
                    args.push('-D' + prop + '=' + value);
                }
            }

            addParameter('sonar.host.url', sonarOptions.instance, 'hostUrl');
            addParameter('sonar.jdbc.url', sonarOptions.instance, 'jdbcUrl');
            addParameter('sonar.jdbc.username', sonarOptions.instance, 'jdbcUsername');
            addParameter('sonar.jdbc.password', sonarOptions.instance, 'jdbcPassword');
            addParameter('sonar.login', sonarOptions.instance, 'login');
            addParameter('sonar.password', sonarOptions.instance, 'password');

            addParameter('sonar.sourceEncoding', sonarOptions, 'sourceEncoding');
            addParameter('sonar.language', sonarOptions, 'language');
            addParameter('sonar.dynamicAnalysis', sonarOptions, 'dynamicAnalysis');
            addParameter('sonar.projectBaseDir', sonarOptions, 'defaultOutputDir');
            addParameter('sonar.scm.disabled', sonarOptions, 'scmDisabled');

            addParameter('sonar.projectKey', data.project, 'key');
            addParameter('sonar.projectName', data.project, 'name');
            addParameter('sonar.projectVersion', data.project, 'version');

            addParameter('sonar.exclusions', data, 'exclusions');
            return args;
        }
function buildArgs ( sonarOptions , data ) { // Default arguments var args = [ '-Dsonar.sources=src' , '-Dsonar.tests=test' , '-Dsonar.javascript.jstestdriver.reportsPath=results' , '-Dsonar.genericcoverage.unitTestReportPaths=' + 'results' + path . sep + 'TESTS-junit.xml' , '-Dsonar.javascript.jstestdriver.itReportsPath=results' , '-Dsonar.javascript.lcov.reportPaths=' + 'results' + path . sep + 'coverage_report.lcov' + ',' + 'results' + path . sep + 'it_coverage_report.lcov' , '-Dsonar.javascript.lcov.reportPath=' + 'results' + path . sep + 'coverage_report.lcov' , '-Dsonar.javascript.lcov.itReportPath=' + 'results' + path . sep + 'it_coverage_report.lcov' ] ; // Add the parameter (-D) only when the 'key' exists in the 'object' function addParameter ( prop , object , key ) { var value = _ . result ( object , key ) ; if ( value !== undefined && value !== null && sonarOptions . excludedProperties . indexOf ( prop ) === - 1 ) { args . push ( '-D' + prop + '=' + value ) ; } } addParameter ( 'sonar.host.url' , sonarOptions . instance , 'hostUrl' ) ; addParameter ( 'sonar.jdbc.url' , sonarOptions . instance , 'jdbcUrl' ) ; addParameter ( 'sonar.jdbc.username' , sonarOptions . instance , 'jdbcUsername' ) ; addParameter ( 'sonar.jdbc.password' , sonarOptions . instance , 'jdbcPassword' ) ; addParameter ( 'sonar.login' , sonarOptions . instance , 'login' ) ; addParameter ( 'sonar.password' , sonarOptions . instance , 'password' ) ; addParameter ( 'sonar.sourceEncoding' , sonarOptions , 'sourceEncoding' ) ; addParameter ( 'sonar.language' , sonarOptions , 'language' ) ; addParameter ( 'sonar.dynamicAnalysis' , sonarOptions , 'dynamicAnalysis' ) ; addParameter ( 'sonar.projectBaseDir' , sonarOptions , 'defaultOutputDir' ) ; addParameter ( 'sonar.scm.disabled' , sonarOptions , 'scmDisabled' ) ; addParameter ( 'sonar.projectKey' , data . project , 'key' ) ; addParameter ( 'sonar.projectName' , data . project , 'name' ) ; addParameter ( 'sonar.projectVersion' , data . project , 'version' ) ; addParameter ( 'sonar.exclusions' , data , 'exclusions' ) ; return args ; }
Builds the arguments that need to be sent to sonar-runner.

@param sonarOptions The sonar options such as username, password etc.
@param data The data such as project name and project version.
@returns The array of command line options for sonar-runner.
Builds the arguments that need to be sent to sonar - runner .