Browse Source

Polish "Add Spring Checkstyle with all checks disabled"

Commit aea0fea5d93bc4922dec4eef1c08f4ca01a9125d

Issue gh-8945
Joe Grandja 5 years ago
parent
commit
94bc19747d
1 changed files with 17 additions and 15 deletions
  1. 17 15
      build.gradle

+ 17 - 15
build.gradle

@@ -41,24 +41,26 @@ subprojects {
 }
 
 allprojects {
-	apply plugin: 'io.spring.javaformat'
-	apply plugin: 'checkstyle'
+	if (!['spring-security-bom', 'spring-security-docs'].contains(project.name)) {
+		apply plugin: 'io.spring.javaformat'
+		apply plugin: 'checkstyle'
 
-	pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
-		configure(plugin) {
-			dependencies {
-				checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:$springJavaformatVersion"
+		pluginManager.withPlugin("io.spring.convention.checkstyle", { plugin ->
+			configure(plugin) {
+				dependencies {
+					checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:$springJavaformatVersion"
+				}
+				checkstyle {
+					toolVersion = '8.34'
+				}
 			}
-			checkstyle {
-				toolVersion = '8.34'
-			}
-		}
-	})
+		})
 
-	if (project.name.contains('sample')) {
-		tasks.whenTaskAdded { task ->
-			if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
-				task.enabled = false
+		if (project.name.contains('sample')) {
+			tasks.whenTaskAdded { task ->
+				if (task.name.contains('format') || task.name.contains('checkFormat') || task.name.contains("checkstyle")) {
+					task.enabled = false
+				}
 			}
 		}
 	}