Skip to content

Commit

Permalink
formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
kjozsa committed Nov 28, 2024
1 parent 0f8f673 commit a57bf3c
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,31 @@ allprojects {
groovyGradle {
target '*.gradle', '**/*.gradle'
targetExclude '**/build/**'
greclipse()
try {
greclipse()
} catch (Exception e) {
// Fallback to basic formatting if Eclipse formatter is not available
indentWithSpaces(4)
}
indentWithSpaces(4)
endWithNewline()
trimTrailingWhitespace()
}

java {
target '**/*.java'
targetExclude '**/build/**'
try {
eclipse().configFile("${rootDir}/config/eclipse/formatter.xml")
} catch (Exception e) {
// Fallback to basic formatting if Eclipse formatter is not available
removeUnusedImports()
trimTrailingWhitespace()
indentWithSpaces(4)
endWithNewline()
}
}

lineEndings 'UNIX'
}

Expand Down Expand Up @@ -409,10 +428,14 @@ configure(project.fineractJavaProjects) {
targetExclude '**/build/**', '**/bin/**', '**/out/**'
importOrder() //sort imports alphabetically
removeUnusedImports()
eclipse().configFile "$rootDir/config/fineractdev-formatter.xml"
endWithNewline()
trimTrailingWhitespace()

try {
eclipse().configFile("$rootDir/config/fineractdev-formatter.xml")
} catch (Exception e) {
// Fallback to basic formatting if Eclipse formatter is not available
indentWithSpaces(4)
endWithNewline()
trimTrailingWhitespace()
}
// Enforce style modifier order
custom 'Modifier ordering', {
def modifierRanking = [
Expand Down

0 comments on commit a57bf3c

Please sign in to comment.