Skip to content

Commit

Permalink
Recognize Kotlin build files for Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbader committed Sep 9, 2024
1 parent c45a3c7 commit a24d0de
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/build_tools/gradle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ pub struct GradleProbe;

impl BuildToolProbe for GradleProbe {
fn probe(&self, dir: &Path) -> Option<Box<dyn BuildTool>> {
// We expect two files to be present
let build_gradle = dir.join("build.gradle");
let settings_gradle = dir.join("settings.gradle");
// We expect two files to be present, either in Groovy or in Kotlin.
let is_gradle_groovy =
dir.join("build.gradle").is_file() && dir.join("settings.gradle").is_file();

if build_gradle.is_file() && settings_gradle.is_file() {
let is_gradle_kotlin =
dir.join("build.gradle.kts").is_file() && dir.join("settings.gradle.kts").is_file();

if is_gradle_groovy || is_gradle_kotlin {
Some(Box::new(Gradle {
dir: dir.to_owned(),
}))
Expand Down

0 comments on commit a24d0de

Please sign in to comment.