Skip to content

Commit

Permalink
[gradle] Add spotless plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowdalic committed Sep 25, 2024
1 parent f79a113 commit 52ca14d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GRADLE ?= ./gradlew

.PHONY: all
all: check jacocoRootReport javadocAll sinttest
all: check format jacocoRootReport javadocAll sinttest

.PHONY: codecov
codecov:
Expand All @@ -12,6 +12,10 @@ codecov:
check:
$(GRADLE) $@

.PHONY: format
format:
$(GRADLE) spotlessApply

.PHONY: eclipse
eclipse:
$(GRADLE) $@
Expand Down
1 change: 1 addition & 0 deletions build-logic/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ dependencies {
implementation "net.ltgt.gradle:gradle-errorprone-plugin:4.0.1"
implementation "gradle.plugin.org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.12.2"
implementation "ru.vyarus:gradle-animalsniffer-plugin:1.7.1"
implementation "com.diffplug.spotless:spotless-plugin-gradle:7.0.0.BETA2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
id 'maven-publish'
id 'net.ltgt.errorprone'
id 'signing'
id 'com.diffplug.spotless'

id 'jacoco-report-aggregation'
id 'test-report-aggregation'
Expand Down Expand Up @@ -335,6 +336,13 @@ coveralls {
jacocoReportPath 'build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml'
}

spotless {
java {
eclipse().configFile("${rootDir}/resources/eclipse/smack_formatter.xml")
importOrderFile("${rootDir}/resources/eclipse/smack.importorder")
}
}

def getGitCommit() {
def projectDirFile = new File("$projectDir")

Expand Down

0 comments on commit 52ca14d

Please sign in to comment.