Pass selected JDK to backend builds
This commit is contained in:
@@ -145,7 +145,11 @@ def discover_executable(name: str, search_roots: Iterable[Path] | None = None) -
|
||||
for root in roots:
|
||||
if not root.exists() or not root.is_dir():
|
||||
continue
|
||||
for candidate in _direct_candidates(name, root):
|
||||
candidates = _direct_candidates(name, root)
|
||||
if name == "JDK":
|
||||
javac_name = "javac.exe" if os.name == "nt" else "javac"
|
||||
candidates.sort(key=lambda candidate: not (candidate.parent / javac_name).is_file())
|
||||
for candidate in candidates:
|
||||
if candidate.exists() and candidate.name.lower() in executable_names:
|
||||
return candidate
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user