@cyclonedx/cdxgen
Version:
Creates CycloneDX Software Bill of Materials (SBOM) from source or container image
125 lines • 5.85 kB
TypeScript
/**
* Method to return the gradle command to use.
*
* @param {string} srcPath Path to look for gradlew wrapper
* @param {string|null} rootPath Root directory to look for gradlew wrapper
*/
export function getGradleCommand(srcPath: string, rootPath: string | null): string;
/**
* Method to combine the general gradle arguments, the sub-commands and the sub-commands' arguments in the correct way
*
* @param {string[]} gradleArguments The general gradle arguments, which must only be added once
* @param {string[]} gradleSubCommands The sub-commands that are to be executed by gradle
* @param {string[]} gradleSubCommandArguments The arguments specific to the sub-command(s), which much be added PER sub-command
* @param {int} gradleCommandLength The length of the full gradle-command
*
* @returns {string[]} Array of arrays of arguments to be added to the gradle command
*/
export function buildGradleCommandArguments(gradleArguments: string[], gradleSubCommands: string[], gradleSubCommandArguments: string[], gradleCommandLength: int): string[];
/**
* Method to split the output produced by Gradle using parallel processing by project
*
* @param {string} rawOutput Full output produced by Gradle using parallel processing
* @param {string[]} relevantTasks The list of gradle tasks whose output need to be considered.
* @returns {map} Map with subProject names as keys and corresponding dependency task outputs as values.
*/
export function splitOutputByGradleProjects(rawOutput: string, relevantTasks: string[]): map;
/**
* Parse gradle projects output
*
* @param {string} rawOutput Raw string output
*/
export function parseGradleProjects(rawOutput: string): {
rootProject: string;
projects: any[];
};
/**
* Parse gradle properties output
*
* @param {string} rawOutput Raw string output
* @param {string} gradleModuleName The name (or 'path') of the module as seen from the root of the project
*/
export function parseGradleProperties(rawOutput: string, gradleModuleName?: string): {
rootProject: string;
projects: any[];
metadata: {
group: string;
version: string;
properties: never[];
};
};
/**
* Execute gradle properties command using multi-threading and return parsed output
*
* @param {string} dir Directory to execute the command
* @param {array} allProjectsStr List of all sub-projects (including the preceding `:`)
* @param {array} extraArgs List of extra arguments to use when calling gradle
*
* @returns {string} The combined output for all subprojects of the Gradle properties task
*/
export function executeParallelGradleProperties(dir: string, allProjectsStr: array, extraArgs?: array): string;
/**
* Method to resolve dependencies from a gradle output
*
* @param {string} rawOutput Text output from gradle dependencies task
* @param {string} rootProjectName Name of the root project
* @param {map} gradleModules Cache with all gradle modules that have already been read
* @param {string} gradleRootPath Root path where Gradle is to be run when getting module information
*/
export function parseGradleDep(rawOutput: string, rootProjectName?: string, gradleModules?: map, gradleRootPath?: string): Promise<{
pkgList: any[];
dependenciesList: {
ref: string;
dependsOn: any[];
}[];
} | {
pkgList?: undefined;
dependenciesList?: undefined;
}>;
/**
* Method that handles object creation for gradle modules.
*
* @param {string} name The simple name of the module
* @param {object} metadata Object with all other parsed data for the gradle module
* @returns {object} An object representing the gradle module in SBOM-format
*/
export function buildObjectForGradleModule(name: string, metadata: object): object;
/**
* Extract Gradle repository URLs from the evaluation output properties.
*
* @param {string} propertiesOutput Properties command output containing repository lines
* @returns {Object} Map of repository names to their URLs
*/
export function extractGradleRepositoryUrls(propertiesOutput: string): Object;
/**
* Parse the distribution URLs resolved by the init script when the
* `resolve-gradle-distribution` feature flag is enabled. The init script emits lines of
* the form `<CDXGEN:distribution>:group:name:version -> https://.../name-version.jar`.
*
* @param {string} stdout Gradle stdout logs containing the distribution markers
* @returns {Object} Map of `group:name:version` keys to their resolved distribution URLs
*/
export function parseGradleResolvedDistributions(stdout: string): Object;
/**
* Parse Gradle info logs to capture HTTP URLs of resolved dependency artifacts.
*
* @param {string} stdout Gradle stdout logs under --info
* @returns {Object} Map of filenames to their resolved distribution URLs
*/
export function parseGradleInfoLogsForUrls(stdout: string): Object;
/**
* Collect Gradle project dependencies by scanning the Gradle cache directory for JAR files
* and their associated POM files.
*
* Uses the `GRADLE_CACHE_DIR` or `GRADLE_USER_HOME` environment variables to locate the
* Gradle files-2.1 cache, then delegates to {@link collectJarNS} to extract namespace
* and purl information from those JARs.
*
* @param {string} _gradleCmd Gradle command (unused; reserved for future use)
* @param {string} _basePath Base project path (unused; reserved for future use)
* @param {boolean} _cleanup Whether to clean up temporary files (unused; reserved for future use)
* @param {boolean} _includeCacheDir Whether to include cache directory (unused; reserved for future use)
* @returns {Promise<Object>} JAR namespace mapping object returned by collectJarNS
*/
export function collectGradleDependencies(_gradleCmd: string, _basePath: string, _cleanup?: boolean, _includeCacheDir?: boolean): Promise<Object>;
//# sourceMappingURL=gradleutils.d.ts.map