Skip to content

Commit 21142a5

Browse files
fix: add Java project detection to detect_project_language
The function only checked for Python and JS/TS markers. Java projects (with pom.xml or build.gradle) always fell through to the PYTHON default. Added Java detection before TypeScript check since build tool files are definitive markers, mirroring setup/detector.py logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8f8d434 commit 21142a5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

codeflash/cli_cmds/init_javascript.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ def detect_project_language(project_root: Path | None = None) -> ProjectLanguage
8787
"""
8888
root = project_root or Path.cwd()
8989

90+
# Java detection (pom.xml or build.gradle is definitive)
91+
has_pom = (root / "pom.xml").exists()
92+
has_gradle = (root / "build.gradle").exists() or (root / "build.gradle.kts").exists()
93+
if has_pom or has_gradle:
94+
return ProjectLanguage.JAVA
95+
9096
has_pyproject = (root / "pyproject.toml").exists()
9197
has_setup_py = (root / "setup.py").exists()
9298
has_package_json = (root / "package.json").exists()

0 commit comments

Comments
 (0)