diff options
author | Sam Rose <hello@samwho.dev> | 2020-01-24 15:22:30 +0000 |
---|---|---|
committer | Matan Kushner <hello@matchai.dev> | 2020-01-24 10:22:30 -0500 |
commit | f4c095de92a09b7143766c4759ab0e60ff0befbb (patch) | |
tree | 1e4a857840561866c06f75a099a5a6ac71ac7af6 /src/modules | |
parent | 25b86dc82da35919c6db8a04a4cd6b74beb234b8 (diff) |
fix(java): Add detection for *.gradle files (#871)
Currently the Java module detection looks for build.gradle specifically, but it's possible to rename build.gradle to *.gradle. This change adds Gradle files to the list of detected file extensions.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/java.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/java.rs b/src/modules/java.rs index 4ad8ac483..1b9e709b1 100644 --- a/src/modules/java.rs +++ b/src/modules/java.rs @@ -8,13 +8,13 @@ use crate::utils; /// Creates a module with the current Java version /// /// Will display the Java version if any of the following criteria are met: -/// - Current directory contains a file with a `.java`, `.class` or `.jar` extension -/// - Current directory contains a `pom.xml`, `build.gradle`, `build.gradle.kts` or `build.sbt` file +/// - Current directory contains a file with a `.java`, `.class`, `.gradle` or `.jar` extension +/// - Current directory contains a `pom.xml`, `build.gradle.kts` or `build.sbt` file pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> { let is_java_project = context .try_begin_scan()? - .set_files(&["pom.xml", "build.gradle", "build.gradle.kts", "build.sbt"]) - .set_extensions(&["java", "class", "jar"]) + .set_files(&["pom.xml", "build.gradle.kts", "build.sbt"]) + .set_extensions(&["java", "class", "jar", "gradle"]) .is_match(); if !is_java_project { |