Skip to content

Commit

Permalink
feat: detect gradle.kts files
Browse files Browse the repository at this point in the history
  • Loading branch information
lili2311 committed Aug 13, 2020
1 parent f386147 commit 57d8d02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/lib/detect.ts
Expand Up @@ -57,6 +57,7 @@ export const AUTO_DETECTABLE_FILES: string[] = [
'requirements.txt',
'build.sbt',
'build.gradle',
'build.gradle.kts',
];

// when file is specified with --file, we look it up here
Expand Down
8 changes: 6 additions & 2 deletions src/lib/find-files.ts
Expand Up @@ -193,7 +193,11 @@ function shouldSkipAddingFile(
): boolean {
if (['gradle'].includes(packageManager) && filePath) {
const rootGradleFile = filteredFiles
.filter((targetFile) => targetFile.endsWith('build.gradle'))
.filter(
(targetFile) =>
targetFile.endsWith('build.gradle') ||
targetFile.endsWith('build.gradle.kts'),
)
.filter((targetFile) => {
const parsedPath = pathLib.parse(targetFile);
const relativePath = pathLib.relative(parsedPath.dir, filePath);
Expand Down Expand Up @@ -238,7 +242,7 @@ function chooseBestManifest(
}
case 'cocoapods': {
debug(
'Encountered multiple cocoapod manifest files, defaulting to Podfile',
'Encountered multiple cocoapods manifest files, defaulting to Podfile',
);
const defaultManifest = files.filter((path) =>
['Podfile'].includes(path.base),
Expand Down

0 comments on commit 57d8d02

Please sign in to comment.