Created
October 6, 2016 00:07
-
-
Save greenlaw110/74dd95c45fb0c03bc21ae3b791d0c9c1 to your computer and use it in GitHub Desktop.
Gulp task for sonar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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