@snyk/java-call-graph-builder
Advanced tools
Comparing version
import 'source-map-support/register'; | ||
export declare function getGradleCommandArgs(targetPath: string): string[]; | ||
export declare function getGradleCommand(targetPath: string): string; | ||
export declare function getClassPathFromGradle(targetPath: string): Promise<string>; | ||
export declare function getClassPathFromGradle(targetPath: string, gradlePath: string): Promise<string>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getClassPathFromGradle = exports.getGradleCommand = exports.getGradleCommandArgs = void 0; | ||
exports.getClassPathFromGradle = exports.getGradleCommandArgs = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -8,3 +8,2 @@ require("source-map-support/register"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const errors_1 = require("./errors"); | ||
@@ -24,16 +23,7 @@ function getGradleCommandArgs(targetPath) { | ||
exports.getGradleCommandArgs = getGradleCommandArgs; | ||
function getGradleCommand(targetPath) { | ||
const pathToWrapper = path.resolve(targetPath || '', '.', 'gradlew'); | ||
if (fs.existsSync(pathToWrapper)) { | ||
return pathToWrapper; | ||
} | ||
return 'gradle'; | ||
} | ||
exports.getGradleCommand = getGradleCommand; | ||
function getClassPathFromGradle(targetPath) { | ||
function getClassPathFromGradle(targetPath, gradlePath) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const cmd = getGradleCommand(targetPath); | ||
const args = getGradleCommandArgs(targetPath); | ||
try { | ||
const output = yield sub_process_1.execute(cmd, args, { cwd: targetPath }); | ||
const output = yield sub_process_1.execute(gradlePath, args, { cwd: targetPath }); | ||
return output.trim(); | ||
@@ -40,0 +30,0 @@ } |
@@ -6,4 +6,4 @@ import 'source-map-support/register'; | ||
export declare function getCallGraphMvn(targetPath: string, timeout?: number): Promise<Graph>; | ||
export declare function getCallGraphGradle(targetPath: string, timeout?: number): Promise<Graph>; | ||
export declare function getCallGraphGradle(targetPath: string, gradlePath?: string, timeout?: number): Promise<Graph>; | ||
export declare function runtimeMetrics(): Metrics; | ||
export declare function findBuildDirs(targetPath: string, packageManager: 'mvn' | 'gradle'): Promise<string[]>; |
@@ -49,6 +49,6 @@ "use strict"; | ||
exports.getCallGraphMvn = getCallGraphMvn; | ||
function getCallGraphGradle(targetPath, timeout) { | ||
function getCallGraphGradle(targetPath, gradlePath = 'gradle', timeout) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const [classPath, targets] = yield Promise.all([ | ||
metrics_1.timeIt('getGradleClassPath', () => gradle_wrapper_1.getClassPathFromGradle(targetPath)), | ||
metrics_1.timeIt('getGradleClassPath', () => gradle_wrapper_1.getClassPathFromGradle(targetPath, gradlePath)), | ||
metrics_1.timeIt('getEntrypoints', () => findBuildDirs(targetPath, 'gradle')), | ||
@@ -55,0 +55,0 @@ ]); |
@@ -73,3 +73,3 @@ { | ||
}, | ||
"version": "1.17.0" | ||
"version": "1.18.0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
6
-14.29%72210
-0.8%965
-1.13%