feat(java): Configure when the module is shown (#2353)

This makes it possible to configure when the java module is shown
based on the contents of a directory.
This commit is contained in:
Thomas O'Donnell
2021-02-21 19:57:09 +01:00
committed by GitHub
parent c0a209f27c
commit 64288c2e04
3 changed files with 30 additions and 24 deletions
+10 -7
View File
@@ -1362,19 +1362,22 @@ disabled = false
## Java
The `java` module shows the currently installed version of Java.
The module will be shown if any of the following conditions are met:
By default the module will be shown if any of the following conditions are met:
- The current directory contains a `pom.xml`, `build.gradle.kts`, `build.sbt`, `.java-version`, `.deps.edn`, `project.clj`, or `build.boot` file
- The current directory contains a file with the `.java`, `.class`, `.gradle`, `.jar`, `.clj`, or `.cljc` extension
### Options
| Option | Default | Description |
| ---------- | ---------------------------------------- | ----------------------------------------------- |
| `format` | `"via [${symbol}(${version} )]($style)"` | The format for the module. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | The style for the module. |
| `disabled` | `false` | Disables the `java` module. |
| Option | Default | Description |
| ------------------- | --------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| `format` | `"via [${symbol}(${version} )]($style)"` | The format for the module. |
| `detect_extensions` | `["java", "class", "gradle", "jar", "cljs", "cljc"]` | Which extensions should trigger this module. |
| `detect_files` | `["pom.xml", "build.gradle.kts", "build.sbt", ".java-version", ".deps.edn", "project.clj", "build.boot"]` | Which filenames should trigger this module. |
| `detect_folders` | `[]` | Which folders should trigger this modules. |
| `symbol` | `"☕ "` | A format string representing the symbol of Java |
| `style` | `"red dimmed"` | The style for the module. |
| `disabled` | `false` | Disables the `java` module. |
### Variables