import gulp from 'gulp'; import project from '../aurelia.json'; import sonar from 'gulp-sonar'; export default function sonarTest( done ) { let version = '0.1.0'; let projectKey = 'sonar:' + project.name + ':' + version; let options = { sonar: { host: { url: project.sonar.sonarURL }, jdbc: { url: project.sonar.sonarDB, username: project.sonar.sonarUser, password: project.sonar.sonarPasswd }, projectKey: projectKey, projectName: project.name, projectVersion: version, // comma-delimited string of source directories sources: project.sonar.sources, exclusions: project.sonar.exclusions, language: 'js', sourceEncoding: 'UTF-8', javascript: { lcov: { reportPath: project.sonar.reportPath } }, exec: { // All these properties will be send to the child_process.exec method (see: https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback ) // Increase the amount of data allowed on stdout or stderr (if this value is exceeded then the child process is killed, and the gulp-sonar will fail). maxBuffer: 1024 * 1024 } } }; // gulp source doesn't matter, all files are referenced in options object above return gulp.src( 'src/**/*.js', { read: false } ) .pipe( sonar( options ) ); }