Skip to content

Commit

Permalink
Added MODULE.bazel to valid workspace root files (#6127)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeFrosch authored Feb 22, 2024
1 parent 8b64eb5 commit 27b3133
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ public class BazelWorkspaceRootProvider implements WorkspaceRootProvider {

private BazelWorkspaceRootProvider() {}

/** Checks for the existence of a WORKSPACE file in the given directory. */
/** Checks for the existence of a WORKSPACE or MODULE.bazel file in the given directory. */
@Override
public boolean isWorkspaceRoot(File file) {
return FileOperationProvider.getInstance().isFile(new File(file, "WORKSPACE"))
|| FileOperationProvider.getInstance().isFile(new File(file, "WORKSPACE.bazel"));
|| FileOperationProvider.getInstance().isFile(new File(file, "WORKSPACE.bazel"))
|| FileOperationProvider.getInstance().isFile(new File(file, "MODULE.bazel"));
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public WorkspaceTypeData getWorkspaceData() throws ConfigurationException {
if (!isWorkspaceRoot(workspaceRootFile)) {
throw new ConfigurationException(
"Invalid workspace root: choose a bazel workspace directory "
+ "(containing a WORKSPACE file)");
+ "(containing a WORKSPACE or MODULE.bazel file)");
}
WorkspaceRoot root = new WorkspaceRoot(workspaceRootFile);
return WorkspaceTypeData.builder()
Expand Down

0 comments on commit 27b3133

Please sign in to comment.