Skip to content

Commit

Permalink
Switch automatic formatting and check to Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Feb 12, 2022
1 parent 1cf99aa commit bfda38d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
run: |
export MAVEN_OPTS="-Xmx512m $TEST_OPTS -XX:+UseStringDeduplication -XX:+UseG1GC -XX:MaxHeapFreeRatio=30 -XX:MinHeapFreeRatio=10"
cd ~
mvn -B -f geoserver/src/pom.xml install -nsu -Prelease -Dfmt.skip=true -DskipTests
mvn -B -f geoserver/src/community/pom.xml install -nsu -DcommunityRelease -Dfmt.skip=true -DskipTests
mvn -B -f geoserver/src/pom.xml test -T2 -nsu -Djvm.opts="$TEST_OPTS" -Prelease -Dfmt.skip=true
mvn -B -f geoserver/src/pom.xml install -nsu -Prelease -Dspotless.apply.skip=true -DskipTests
mvn -B -f geoserver/src/community/pom.xml install -nsu -DcommunityRelease -Dspotless.apply.skip=true -DskipTests
mvn -B -f geoserver/src/pom.xml test -T2 -nsu -Djvm.opts="$TEST_OPTS" -Prelease -Dspotless.apply.skip=true
- name: Remove SNAPSHOT jars from repository
run: |
find ~/.m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
6 changes: 3 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B clean install -Dfmt.skip=true -Dall -T2 -Prelease --file geowebcache/pom.xml
run: mvn -B clean install -Dspotless.apply.skip=true -Dall -T2 -Prelease --file geowebcache/pom.xml
- name: Remove SNAPSHOT jars from repository
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
Expand All @@ -43,7 +43,7 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B clean install -Dfmt.skip=true -Dall -T2 -Prelease --file geowebcache/pom.xml
run: mvn -B clean install -Dspotless.apply.skip=true -Dall -T2 -Prelease --file geowebcache/pom.xml
- name: Remove SNAPSHOT jars from repository
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
Expand All @@ -64,7 +64,7 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B clean install -Dfmt.action=check -Dpom.fmt.action=verify -Dqa -DskipTests=true -Dall -T2 -Prelease --file geowebcache/pom.xml
run: mvn -B clean install -Dspotless.action=check -Dpom.fmt.action=verify -Dqa -DskipTests=true -Dall -T2 -Prelease --file geowebcache/pom.xml
- name: Remove SNAPSHOT jars from repository
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B clean install -T2 -Prelease --file geowebcache/pom.xml
run: mvn -B clean install -T2 -Prelease --file geowebcache/pom.xml -Dspotless.apply.skip=true
- name: Remove SNAPSHOT jars from repository
run: |
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {}
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B clean install -Dall -T2 -Prelease --file geowebcache/pom.xml
run: mvn --% -B clean install -Dall -T2 -Dspotless.apply.skip=true --file geowebcache/pom.xml
- name: Remove SNAPSHOT jars from repository
run: |
cmd --% /c for /f %i in ('dir /a:d /s /b %userprofile%\*SNAPSHOT*') do rd /s /q %i
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ release.rb
# Intellij
.idea/
*.iml
# spotless up to date checks
.spotless-index

29 changes: 18 additions & 11 deletions geowebcache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@
<imageio-ext.version>1.3.11</imageio-ext.version>
<hazelcast.version>3.11-BETA-1</hazelcast.version>
<joda-time.version>2.8.1</joda-time.version>
<fmt.action>format</fmt.action>
<fmt.skip>false</fmt.skip>
<spotless.action>apply</spotless.action>
<spotless.apply.skip>false</spotless.apply.skip>
<pom.fmt.action>sort</pom.fmt.action>
<pom.fmt.skip>${fmt.skip}</pom.fmt.skip>
<pom.fmt.skip>${spotless.apply.skip}</pom.fmt.skip>
<jackson.version>2.10.1</jackson.version>
<jetty.version>9.4.18.v20190429</jetty.version>
<errorProneFlags></errorProneFlags>
Expand Down Expand Up @@ -619,21 +619,28 @@
</plugin>

<plugin>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.4.0</version>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.20.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>${fmt.action}</goal>
<goal>${spotless.action}</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>false</verbose>
<filesNamePattern>.*\.java</filesNamePattern>
<skip>${fmt.skip}</skip>
<style>aosp</style>
<java>
<googleJavaFormat>
<version>1.7</version>
<style>AOSP</style>
</googleJavaFormat>
</java>
<upToDateChecking>
<enabled>true</enabled>
<indexFile>${project.basedir}/.spotless-index</indexFile>
</upToDateChecking>
</configuration>
</plugin>

Expand Down

0 comments on commit bfda38d

Please sign in to comment.