Skip to content

Commit

Permalink
fix: Don't require rules_java and rules_python for bazel 7 and older (b…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Pasternak committed Nov 25, 2024
1 parent 72d9540 commit 0f852dd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ private void writeLanguageInfo(
// TODO: adapt the logic to query sync
boolean isQuerySync = projectData.map(BlazeProjectData::isQuerySync).orElse(false);
var externalWorkspaceData = isQuerySync ? null : projectData.map(BlazeProjectData::getExternalWorkspaceData).orElse(null);
var isAtLeastBazel8 = projectData.map(it -> it.getBlazeVersionData().bazelIsAtLeastVersion(8, 0, 0)).orElse(false);
var isJavaEnabled = activeLanguages.contains(LanguageClass.JAVA) &&
(isQuerySync || (externalWorkspaceData != null && externalWorkspaceData.getByRepoName("rules_java") != null));
(isQuerySync || (externalWorkspaceData != null && (!isAtLeastBazel8 || externalWorkspaceData.getByRepoName("rules_java") != null)));
var isPythonEnabled = activeLanguages.contains(LanguageClass.PYTHON) &&
(isQuerySync || (externalWorkspaceData != null && externalWorkspaceData.getByRepoName("rules_python") != null));
var isAtLeastBazel8 = projectData.map(it -> it.getBlazeVersionData().bazelIsAtLeastVersion(8, 0, 0)).orElse(false);
(isQuerySync || (externalWorkspaceData != null && (!isAtLeastBazel8 || externalWorkspaceData.getByRepoName("rules_python") != null)));
return Map.of(
"bazel8OrAbove", isAtLeastBazel8 ? "true" : "false",
"isJavaEnabled", isJavaEnabled ? "true" : "false",
Expand Down

0 comments on commit 0f852dd

Please sign in to comment.