mirror of https://github.com/apache/lucene.git
Upgrade spotless and use runToFixMessage for 'gradlew tidy' hint. (#834)
This commit is contained in:
parent
2080caff3f
commit
a53d05b9f9
|
@ -25,7 +25,7 @@ plugins {
|
|||
id 'de.thetaphi.forbiddenapis' version '3.3' apply false
|
||||
id "de.undercouch.download" version "4.1.1" apply false
|
||||
id "net.ltgt.errorprone" version "2.0.2" apply false
|
||||
id 'com.diffplug.spotless' version "5.14.3" apply false
|
||||
id 'com.diffplug.spotless' version "6.5.0" apply false
|
||||
}
|
||||
|
||||
apply from: file('gradle/globals.gradle')
|
||||
|
|
|
@ -94,6 +94,11 @@ configure(project(":lucene").subprojects) { prj ->
|
|||
}
|
||||
}
|
||||
|
||||
// Emit a custom message about how to fix formatting errors.
|
||||
tasks.matching { task -> task.name == "spotlessJavaCheck" }.configureEach {
|
||||
runToFixMessage.set("\nIMPORTANT: run the top-level './gradlew tidy' to format code automatically (see help/formatting.txt for more info).")
|
||||
}
|
||||
|
||||
// Add an alias to 'spotlessApply' simply called 'tidy' and wire up
|
||||
// spotlessCheck to convention's check.
|
||||
task tidy() {
|
||||
|
@ -111,9 +116,3 @@ configure(project(":lucene").subprojects) { prj ->
|
|||
v.dependsOn ":checkJdkInternalsExportedToGradle"
|
||||
}
|
||||
}
|
||||
|
||||
gradle.taskGraph.afterTask { Task task, TaskState state ->
|
||||
if (task.name == 'spotlessJavaCheck' && state.failure) {
|
||||
throw new GradleException("\n****************************\n*PLEASE RUN ./gradlew tidy!*\n****************************");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue