mirror of
https://codeberg.org/gitnex/GitNex.git
synced 2023-12-13 20:50:18 +01:00
Add simple gradle format target
This commit is contained in:
parent
5c23e4ee52
commit
22e138a990
17
build.gradle
17
build.gradle
|
@ -22,3 +22,20 @@ allprojects {
|
|||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
task format {
|
||||
def proc
|
||||
// first, try `intellij-idea-ultimate-edition` as command
|
||||
try {
|
||||
proc = 'intellij-idea-ultimate-edition format -s ".idea/codeStyles/Project.xml" -m "${PLUGIN_FILE_PATTERN:-"*"}" -r .'.execute()
|
||||
} catch (ignored) {
|
||||
try {
|
||||
proc = 'intellij-idea-community-edition format -s ".idea/codeStyles/Project.xml" -m "${PLUGIN_FILE_PATTERN:-"*"}" -r .'.execute()
|
||||
} catch (ignored2) {
|
||||
println('Couldn\'t format files, IntelliJ binary is missing')
|
||||
return
|
||||
}
|
||||
}
|
||||
proc.consumeProcessOutput(System.out, System.err)
|
||||
proc.waitFor()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue