Socket
Socket
Sign inDemoInstall

snyk-gradle-plugin

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-gradle-plugin - npm Package Compare versions

Comparing version 4.4.0 to 4.5.0

6

dist/index.d.ts

@@ -31,3 +31,7 @@ import { DepGraph } from '@snyk/dep-graph';

declare function getVersionBuildInfo(gradleVersionOutput: string): VersionBuildInfo | undefined;
export declare function getGradleVersion(root: string, command: string): Promise<string>;
export declare function getGradleVersion(root: string, command: string, args?: string[]): Promise<string>;
export declare function generateWrapperProcessArgs(commandPath: string, args: string[]): {
command: string;
args: string[];
};
declare function splitCoordinate(coordinate: string): Partial<PomCoords>;

@@ -34,0 +38,0 @@ export declare function processProjectsInExtractedJSON(extractedJSON: JsonDepsScriptResult, verbose?: boolean, coordinateMap?: CoordinateMap): Promise<JsonDepsScriptResult>;

33

dist/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.exportsForTests = exports.processProjectsInExtractedJSON = exports.getGradleVersion = exports.inspect = exports.debugLog = void 0;
exports.exportsForTests = exports.processProjectsInExtractedJSON = exports.generateWrapperProcessArgs = exports.getGradleVersion = exports.inspect = exports.debugLog = void 0;
const os = require("os");

@@ -253,7 +253,8 @@ const fs = require("fs");

}
async function getGradleVersion(root, command) {
async function getGradleVersion(root, command, args) {
debugLog('`gradle -v` command run: ' + command);
let gradleVersionOutput = '[COULD NOT RUN gradle -v]';
const completeArgs = args ? args.concat(['-v']) : ['-v'];
try {
gradleVersionOutput = await subProcess.execute(command, ['-v'], {
gradleVersionOutput = await subProcess.execute(command, completeArgs, {
cwd: root,

@@ -268,2 +269,15 @@ });

exports.getGradleVersion = getGradleVersion;
function generateWrapperProcessArgs(commandPath, args) {
let parseArgs = [];
let command = commandPath;
const isWinLocal = /^win/.test(os.platform());
if (isWinLocal && command !== 'gradle') {
command = 'cmd.exe';
parseArgs.push('/c');
parseArgs.push(commandPath);
}
parseArgs = parseArgs.concat(args);
return { command, args: parseArgs };
}
exports.generateWrapperProcessArgs = generateWrapperProcessArgs;
async function getAllDepsWithPlugin(root, targetFile, options, gradleVersion) {

@@ -273,5 +287,6 @@ const command = getCommand(root, targetFile);

const args = buildArgs(root, targetFile, injectedPluginFilePath, options, gradleVersion);
const fullCommandText = 'gradle command: ' + command + ' ' + args.join(' ');
const { command: wrapperedCommand, args: wrapperArgs } = generateWrapperProcessArgs(command, args);
const fullCommandText = 'gradle command: ' + wrapperedCommand + ' ' + wrapperArgs.join(' ');
debugLog('Executing ' + fullCommandText);
const stdoutText = await subProcess.execute(command, args, { cwd: root }, printIfEcho);
const stdoutText = await subProcess.execute(wrapperedCommand, wrapperArgs, { cwd: root }, printIfEcho);
if (cleanupCallback) {

@@ -298,3 +313,4 @@ cleanupCallback();

const command = getCommand(root, targetFile);
const gradleVersion = await getGradleVersion(root, command);
const { command: wrapperedCommand, args: wrapperArgs } = generateWrapperProcessArgs(command, []);
const gradleVersion = await getGradleVersion(root, wrapperedCommand, wrapperArgs);
if (gradleVersion.match(/Gradle 1/)) {

@@ -425,3 +441,2 @@ throw new Error('Gradle 1.x is not supported');

const isWinLocal = /^win/.test(os.platform()); // local check, can be stubbed in tests
const quotLocal = isWinLocal ? '"' : "'";
const wrapperScript = isWinLocal ? 'gradlew.bat' : './gradlew';

@@ -431,3 +446,3 @@ // try to find a sibling wrapper script first

if (fs.existsSync(pathToWrapper)) {
return quotLocal + pathToWrapper + quotLocal;
return pathToWrapper;
}

@@ -437,3 +452,3 @@ // now try to find a wrapper in the root

if (fs.existsSync(pathToWrapper)) {
return quotLocal + pathToWrapper + quotLocal;
return pathToWrapper;
}

@@ -440,0 +455,0 @@ return 'gradle';

@@ -11,3 +11,3 @@ "use strict";

const spawnOptions = {
shell: true,
shell: false,
env: { ...process.env },

@@ -21,3 +21,3 @@ };

}
args = (0, shescape_1.quoteAll)(args, spawnOptions);
args = (0, shescape_1.escapeAll)(args, spawnOptions);
// Before spawning an external process, we look if we need to restore the system proxy configuration,

@@ -24,0 +24,0 @@ // which overides the cli internal proxy configuration.

@@ -57,3 +57,3 @@ {

},
"version": "4.4.0"
"version": "4.5.0"
}

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