/
index.ts
40 lines (36 loc) · 1.06 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { LANGUAGE_JAVA } from '../../constants/languages';
import * as gradleVersioning from '../../versioning/gradle';
import type {
ExtractConfig,
PackageFile,
UpdateDependencyConfig,
} from '../types';
import * as deep from './deep';
import * as shallow from './shallow';
import type { GradleManagerData } from './types';
export function extractAllPackageFiles(
config: ExtractConfig,
packageFiles: string[]
): Promise<PackageFile[] | null> {
return config.deepExtract
? deep.extractAllPackageFiles(config, packageFiles)
: shallow.extractAllPackageFiles(config, packageFiles);
}
export function updateDependency(
params: UpdateDependencyConfig<GradleManagerData>
): string | null {
return params.upgrade?.deepExtract
? deep.updateDependency(params)
: shallow.updateDependency(params);
}
export const language = LANGUAGE_JAVA;
export const defaultConfig = {
fileMatch: [
'\\.gradle(\\.kts)?$',
'(^|/)gradle.properties$',
'(^|\\/)gradle\\/.+\\.toml$',
'\\.versions\\.toml$',
],
timeout: 600,
versioning: gradleVersioning.id,
};