UNPKG

2.46 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;
37declare function splitCoordinate(coordinate: string): Partial<PomCoords>;
38export declare function processProjectsInExtractedJSON(extractedJSON: JsonDepsScriptResult, coordinateMap?: CoordinateMap): Promise<JsonDepsScriptResult>;
39declare function toCamelCase(input: string): string;
40declare function buildArgs(root: string, targetFile: string | null, initGradlePath: string, options: Options, gradleVersion: string): string[];
41export declare const exportsForTests: {
42 buildArgs: typeof buildArgs;
43 extractJsonFromScriptOutput: typeof extractJsonFromScriptOutput;
44 getVersionBuildInfo: typeof getVersionBuildInfo;
45 toCamelCase: typeof toCamelCase;
46 getGradleAttributesPretty: typeof getGradleAttributesPretty;
47 splitCoordinate: typeof splitCoordinate;
48};
49export {};