Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-sonar-runner

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-sonar-runner - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

__tests__/expected/custom_options

37

Gruntfile.js

@@ -50,6 +50,11 @@ /*

projectName: 'Grunt Sonar Runner',
projectVersion: '3.0.0',
sources: ['tasks', 'test'].join(','),
projectVersion: '3.0.1',
sources: ['tasks'].join(','),
language: 'js',
sourceEncoding: 'UTF-8'
sourceEncoding: 'UTF-8',
javascript: {
lcov: {
reportPaths: 'coverage/lcov.info'
}
}
}

@@ -74,6 +79,6 @@ }

},
projectKey: 'sonar:grunt-sonar-runner:0.1.0',
projectKey: 'sonar:grunt-sonar-runner:3.0.1',
projectName: 'Grunt Sonar Runner',
projectVersion: '0.10',
sources: ['test'].join(','),
projectVersion: '3.0.1',
sources: ['tasks'].join(','),
exclusions: '**/R.js'

@@ -84,13 +89,8 @@ }

},
// Unit tests.
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/**/*.js']
}
run: {
jest_test: {
exec: 'npm run jest-test --silent'
}
}
});

@@ -104,9 +104,8 @@

grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-run');
grunt.registerTask('test', ['clean', 'sonarRunner:dryRun', 'run:jest_test']);
grunt.registerTask('test', ['clean', 'sonarRunner:dryRun', 'mochaTest']);
grunt.registerTask('default', ['jshint', 'test']);
};
{
"name": "grunt-sonar-runner",
"description": "Sonar Analysis Runner from grunt. The major version is kept in sync with sonar runner distribution version.",
"version": "3.0.0",
"homepage": "https://github.com/skhatri/grunt-sonar-runner",
"author": {
"name": "Suresh Khatri",
"email": "servlet2@msn.com"
},
"repository": "skhatri/grunt-sonar-runner",
"bugs": {
"url": "https://github.com/skhatri/grunt-sonar-runner/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/skhatri/grunt-sonar-runner/blob/master/LICENSE-MIT"
}
],
"engines": {
"node": ">= 0.10"
},
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-mocha-test": "^0.12.4",
"should": "^9.0.0"
},
"peerDependencies": {
"grunt": ">=0.4.5"
},
"keywords": [
"gruntplugin",
"sonar",
"sonar-runner"
],
"dependencies": {
"grunt-cli": "^1.3.2"
"name": "grunt-sonar-runner",
"description": "Sonar Analysis Runner from grunt. The major version is kept in sync with sonar runner distribution version.",
"version": "3.0.1",
"homepage": "https://github.com/skhatri/grunt-sonar-runner",
"author": {
"name": "Suresh Khatri",
"email": "servlet2@msn.com"
},
"repository": "skhatri/grunt-sonar-runner",
"bugs": {
"url": "https://github.com/skhatri/grunt-sonar-runner/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/skhatri/grunt-sonar-runner/blob/master/LICENSE-MIT"
}
],
"engines": {
"node": ">= 0.10"
},
"scripts": {
"test": "jest",
"jest-test": "jest --coverage"
},
"devDependencies": {
"grunt": "^1.0.1",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-run": "^0.8.1",
"jest": "^26.6.3",
"should": "^13.2.3"
},
"peerDependencies": {
"grunt": ">=0.4.5"
},
"keywords": [
"gruntplugin",
"sonar",
"sonar-runner",
"sonar-scanner"
],
"dependencies": {
"grunt-cli": "^1.3.2"
}
}

@@ -11,14 +11,16 @@ /*

var childProcess = require('child_process'), format = require('util').format, os = require('os'), path = require('path');
let childProcess = require('child_process'), format = require('util').format, os = require('os'),
path = require('path');
module.exports = function (grunt) {
var SONAR_SCANNER_HOME = path.normalize(process.env.SONAR_SCANNER_HOME || __dirname+'/../sonar-scanner-4.5');
var SONAR_SCANNER_OPTS = process.env.SONAR_SCANNER_OPTS || "";
const SONAR_SCANNER_HOME = path.normalize(process.env.SONAR_SCANNER_HOME || __dirname + '/../sonar-scanner-4.5');
const SONAR_SCANNER_OPTS = process.env.SONAR_SCANNER_OPTS || "";
var JAR = SONAR_SCANNER_HOME + '/lib/sonar-scanner-cli-4.5.0.2216.jar';
var SONAR_SCANNER_COMMAND = 'java ' + '-Dscanner.home="' + SONAR_SCANNER_HOME + '"' + SONAR_SCANNER_OPTS + ' -jar "' + JAR +'"';
var LIST_CMD = (/^win/).test(os.platform()) ? 'dir "' + JAR + '"' : 'ls "' + JAR + '"';
let JAR = `${SONAR_SCANNER_HOME}/lib/sonar-scanner-cli-4.5.0.2216.jar`;
let SONAR_SCANNER_COMMAND = `java -Dscanner.home="${SONAR_SCANNER_HOME}" ${SONAR_SCANNER_OPTS} -jar "${JAR}"`;
let LIST_CMD = (/^win/).test(os.platform()) ? 'dir "' + JAR + '"' : 'ls "' + JAR + '"';
var mergeOptions = function (prefix, effectiveOptions, obj) {
for (var j in obj) {
let mergeOptions = function (prefix, effectiveOptions, obj) {
for (let j in obj) {
if (obj.hasOwnProperty(j)) {

@@ -37,3 +39,3 @@ if (typeof obj[j] === 'object') {

grunt.registerMultiTask('sonarRunner', 'Sonar Analysis Runner from grunt', function () {
var options = this.options({
let options = this.options({
debug: false,

@@ -43,8 +45,7 @@ separator: os.EOL,

});
var data = this.data;
var callback = (typeof data.callback === 'function') ? data.callback : function () {
let data = this.data;
let callback = (typeof data.callback === 'function') ? data.callback : () => {
};
var dryRun = options.dryRun;
var done = this.async();
let dryRun = options.dryRun;
let done = this.async();
options.sonar.sourceEncoding = options.sonar.sourceEncoding || 'UTF-8';

@@ -58,6 +59,6 @@ if (!options.projectHome) {

var effectiveOptions = Object.create(null);
let effectiveOptions = Object.create(null);
mergeOptions('sonar.', effectiveOptions, options.sonar);
var props = [];
let props = [];
if (options.debug) {

@@ -67,4 +68,4 @@ grunt.log.writeln('Effective Sonar Options');

}
for (var o in effectiveOptions) {
var line = o + '=' + effectiveOptions[o];
for (let o in effectiveOptions) {
let line = `${o}=${effectiveOptions[o]}`;
props.push(line);

@@ -74,12 +75,12 @@ if (options.debug) {

}
}
}
if (options.projectHome) {
var projectProperties = path.join(options.projectHome, ".sonar/conf/sonar-project.properties");
SONAR_SCANNER_COMMAND += ' -Dproject.settings=' + projectProperties + ' -Dproject.home=' + options.projectHome;
grunt.file.write(projectProperties, props.join(options.separator));
let projectProperties = path.join(options.projectHome, ".sonar/conf/sonar-project.properties");
SONAR_SCANNER_COMMAND += ' -Dproject.settings=' + projectProperties + ' -Dproject.home=' + options.projectHome;
grunt.file.write(projectProperties, props.join(options.separator));
} else {
grunt.file.write(SONAR_SCANNER_HOME + '/conf/sonar-scanner.properties', props.join(options.separator));
}
if (options.debug) {

@@ -90,9 +91,8 @@ grunt.log.writeln('Sonar client configured ');

var execCmd = dryRun ? LIST_CMD : SONAR_SCANNER_COMMAND;
let execCmd = dryRun ? LIST_CMD : SONAR_SCANNER_COMMAND;
grunt.log.writeln("sonar-scanner CMD: \n\n" + SONAR_SCANNER_COMMAND +"\n");
grunt.log.writeln("sonar-scanner CMD: \n\n" + SONAR_SCANNER_COMMAND + "\n");
var exec = childProcess.exec(execCmd,
options.maxBuffer ? { maxBuffer: options.maxBuffer } : {},
callback);
let exec = childProcess.exec(execCmd,
options.maxBuffer ? {maxBuffer: options.maxBuffer} : {}, callback);

@@ -99,0 +99,0 @@ exec.stdout.on('data', function (c) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc