diff --git a/extension/src/stores/RootProjectsStore.ts b/extension/src/stores/RootProjectsStore.ts index f694e8b6e..2f07a6f89 100644 --- a/extension/src/stores/RootProjectsStore.ts +++ b/extension/src/stores/RootProjectsStore.ts @@ -7,7 +7,7 @@ import { RootProject } from "../rootProject/RootProject"; import { GRADLE_BUILD_FILE_NAMES } from "../constant"; async function getNestedRootProjectFolders(): Promise { - const matchingNestedWrapperFiles = await vscode.workspace.findFiles("**/{gradlew,gradlew.bat}"); + const matchingNestedWrapperFiles = await vscode.workspace.findFiles("**/{settings.gradle,settings.gradle.kts}"); return [...new Set(matchingNestedWrapperFiles.map((uri) => path.dirname(uri.fsPath)))]; } diff --git a/extension/src/test/testUtil.ts b/extension/src/test/testUtil.ts index 45ca12f0e..be0f6c33b 100644 --- a/extension/src/test/testUtil.ts +++ b/extension/src/test/testUtil.ts @@ -86,13 +86,13 @@ export function stubWorkspaceFolders(workspaceFolders: vscode.WorkspaceFolder[]) const getWorkspaceFolderStub = sinon.stub(vscode.workspace, "getWorkspaceFolder"); const dirnameStub = sinon.stub(path, "dirname"); workspaceFolders.forEach((workspaceFolder) => { - existsSyncStub.withArgs(path.join(workspaceFolder.uri.fsPath, "gradlew")).returns(true); + existsSyncStub.withArgs(path.join(workspaceFolder.uri.fsPath, "settings.gradle")).returns(true); getWorkspaceFolderStub.withArgs(sinon.match.has("fsPath", workspaceFolder.uri.fsPath)).returns(workspaceFolder); dirnameStub.withArgs(workspaceFolder.uri.fsPath).returns(workspaceFolder.uri.fsPath); }); sinon .stub(vscode.workspace, "findFiles") - .withArgs("**/{gradlew,gradlew.bat}") + .withArgs("**/{settings.gradle,settings.gradle.kts}") .returns(Promise.resolve(workspaceFolders.map((folder) => folder.uri))); } diff --git a/extension/src/util/index.ts b/extension/src/util/index.ts index 27d9ba0ef..cf05ca677 100644 --- a/extension/src/util/index.ts +++ b/extension/src/util/index.ts @@ -57,8 +57,8 @@ export function waitOnTcp(host: string, port: number): Promise { export function isGradleRootProject(rootProject: RootProject): boolean { return ( - fs.existsSync(path.join(rootProject.getProjectUri().fsPath, "gradlew")) || - fs.existsSync(path.join(rootProject.getProjectUri().fsPath, "gradlew.bat")) + fs.existsSync(path.join(rootProject.getProjectUri().fsPath, "settings.gradle")) || + fs.existsSync(path.join(rootProject.getProjectUri().fsPath, "settings.gradle.kts")) ); }