Skip to content

Commit

Permalink
Fix codeanalyzer.jar not being a PosixPath
Browse files Browse the repository at this point in the history
Signed-off-by: Rahul Krishna <[email protected]>
  • Loading branch information
rahlk committed Oct 21, 2024
1 parent e567b5c commit b88ead0
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 110 deletions.
4 changes: 2 additions & 2 deletions cldk/analysis/java/codeanalyzer/codeanalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ def _get_codeanalyzer_exec(self) -> List[str]:
if self.analysis_backend_path:
analysis_backend_path = Path(self.analysis_backend_path)
logger.info(f"Using codeanalyzer.jar from {analysis_backend_path}")
codeanalyzer_jar_file = next(analysis_backend_path.glob("*.jar"), None)
codeanalyzer_jar_file = next(analysis_backend_path.rglob("codeanalyzer-*.jar"), None)
if codeanalyzer_jar_file is None:
raise CodeanalyzerExecutionException(f"No codeanalyzer jar found in {analysis_backend_path}")
codeanalyzer_exec = shlex.split(f"java -jar {analysis_backend_path / codeanalyzer_jar_file}")
else:
with resources.as_file(resources.files("cldk.analysis.java.codeanalyzer.jar")) as codeanalyzer_jar_path:
codeanalyzer_jar_file = next(codeanalyzer_jar_path / "*.jar", None)
codeanalyzer_jar_file = next(codeanalyzer_jar_path.rglob("codeanalyzer-*.jar"), None)
codeanalyzer_exec = shlex.split(f"java -jar {codeanalyzer_jar_file}")
return codeanalyzer_exec

Expand Down
Loading

0 comments on commit b88ead0

Please sign in to comment.