Add spring-javaformat plugin

Add spring-javaformat plugin but disable it for all sample projects.

Issue gh-8945
This commit is contained in:
Phillip Webb 2020-07-23 14:15:24 -07:00 committed by Rob Winch
parent 9caa39e370
commit 81d9c6cac5
2 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,7 @@
buildscript {
dependencies {
classpath 'io.spring.gradle:spring-build-conventions:0.0.33.RELEASE'
classpath "io.spring.javaformat:spring-javaformat-gradle-plugin:$springJavaformatVersion"
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath 'io.spring.nohttp:nohttp-gradle:0.0.5.RELEASE'
classpath "io.freefair.gradle:aspectj-plugin:5.0.1"
@ -34,12 +35,22 @@ subprojects {
plugins.withType(JavaPlugin) {
project.sourceCompatibility='1.8'
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
}
allprojects {
apply plugin: 'io.spring.javaformat'
if (project.name.contains('sample')) {
tasks.whenTaskAdded { task ->
if (task.name.contains('format') || task.name.contains('checkFormat')) {
task.enabled = false
}
}
}
}
nohttp {
allowlistFile = project.file("etc/nohttp/allowlist.lines")
}

View File

@ -1,5 +1,6 @@
aspectjVersion=1.9.3
gaeVersion=1.9.80
springJavaformatVersion=0.0.24
springBootVersion=2.4.0-M1
version=5.4.0-SNAPSHOT
kotlinVersion=1.3.72