Eclipse Mars.
I've installed the "Minimalist" syntax highlighter editor plugin... as discussed here, but is there any way currently to get auto-formatting on .gradle files?
It may well be that there's a Groovy auto-formatting editor plugin... but that won't (I presume) do all the syntax highlighting for Gradle.
you can use the spotless plugin for gradle to format source files as well as other types of build files including the gradle files.
If you just need something basic, you can format like this:
spotless {
format 'misc' {
target '*.gradle', '*.md', '.gitignore'
trimTrailingWhitespace()
indentWithTabs()
endWithNewLine()
}
}
This has the benefit of working with any IDE and you can even hook it into the build target to run automatically.
afterEvaluate {
tasks.getByName('spotlessheck').dependsOn('spotlessApply')
}
Example with spotless 5.8.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With