Skip to content

Instantly share code, notes, and snippets.

@greenlaw110
Created October 6, 2016 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greenlaw110/74dd95c45fb0c03bc21ae3b791d0c9c1 to your computer and use it in GitHub Desktop.
Save greenlaw110/74dd95c45fb0c03bc21ae3b791d0c9c1 to your computer and use it in GitHub Desktop.
Gulp task for sonar
var git = require('gulp-git');
var replace = require('gulp-replace');
var sonar = require('gulp-sonar');
var util = require('util');
/*
SONAR
*/
gulp.task('sonar', function () {
var options = {
sonar: {
host: {
url: 'http://localhost:9000'
},
projectKey: 'connectable-ui',
projectName: 'Connectable UI',
projectVersion: '1.0.0',
// comma-delimited string of source directories
sources: 'app/js',
language: 'js',
sourceEncoding: 'UTF-8',
javascript: {
lcov: {
reportPath: 'test/sonar_report/lcov.info'
}
},
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('thisFileDoesNotExist.js', { read: false })
.pipe(sonar(options))
.on('error', util.log);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment