UNPKG

2.7 kBTypeScriptView Raw
1import { DepGraph } from '@snyk/dep-graph';
2import { legacyPlugin as api } from '@snyk/cli-interface';
3import { getGradleAttributesPretty } from './gradle-attributes-pretty';
4import { GradleGraph } from './graph';
5import type { CoordinateMap, PomCoords, Sha1Map, SnykHttpClient } from './types';
6export declare function debugLog(s: string): void;
7export interface GradleInspectOptions {
8 'configuration-matching'?: string;
9 'configuration-attributes'?: string;
10 daemon?: boolean;
11 initScript?: string;
12 gradleNormalizeDeps?: boolean;
13}
14type Options = api.InspectOptions & GradleInspectOptions;
15type VersionBuildInfo = api.VersionBuildInfo;
16export declare function inspect(root: string, targetFile: string, options?: api.SingleSubprojectInspectOptions & GradleInspectOptions, snykHttpClient?: SnykHttpClient): Promise<api.SinglePackageResult>;
17export declare function inspect(root: string, targetFile: string, options: api.MultiSubprojectInspectOptions & GradleInspectOptions, snykHttpClient?: SnykHttpClient): Promise<api.MultiProjectResult>;
18export interface JsonDepsScriptResult {
19 defaultProject: string;
20 defaultProjectKey: string;
21 projects: ProjectsDict;
22 allSubProjectNames: string[];
23 versionBuildInfo?: VersionBuildInfo;
24 sha1Map?: Sha1Map;
25}
26interface ProjectsDict {
27 [project: string]: GradleProjectInfo;
28}
29interface GradleProjectInfo {
30 depGraph?: DepGraph;
31 gradleGraph?: GradleGraph;
32 targetFile: string;
33 projectVersion: string;
34}
35declare function extractJsonFromScriptOutput(stdoutText: string): JsonDepsScriptResult;
36declare function getVersionBuildInfo(gradleVersionOutput: string): VersionBuildInfo | undefined;
37export declare function getGradleVersion(root: string, command: string, args?: string[]): Promise<string>;
38export declare function generateWrapperProcessArgs(commandPath: string, args: string[]): {
39 command: string;
40 args: string[];
41};
42declare function splitCoordinate(coordinate: string): Partial<PomCoords>;
43export declare function processProjectsInExtractedJSON(extractedJSON: JsonDepsScriptResult, coordinateMap?: CoordinateMap): Promise<JsonDepsScriptResult>;
44declare function toCamelCase(input: string): string;
45declare function buildArgs(root: string, targetFile: string | null, initGradlePath: string, options: Options, gradleVersion: string): string[];
46export declare const exportsForTests: {
47 buildArgs: typeof buildArgs;
48 extractJsonFromScriptOutput: typeof extractJsonFromScriptOutput;
49 getVersionBuildInfo: typeof getVersionBuildInfo;
50 toCamelCase: typeof toCamelCase;
51 getGradleAttributesPretty: typeof getGradleAttributesPretty;
52 splitCoordinate: typeof splitCoordinate;
53};
54export {};