From 039f0441c6aca634737f6a03993885d16fed8cf5 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Fri, 30 Aug 2024 02:14:49 +0200 Subject: [PATCH] Alternative solution to execute spotlessCheck first during a build (#7541) Signed-off-by: Fabio Di Fabio --- build.gradle | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index 6211183a7a..41c309030c 100644 --- a/build.gradle +++ b/build.gradle @@ -45,10 +45,6 @@ sonarqube { } } -tasks.register('spotlessCheckFast') { - dependsOn subprojects.collect { it.tasks.withType(com.diffplug.gradle.spotless.SpotlessCheck) } -} - project.tasks["sonarqube"].dependsOn "jacocoRootReport" if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) { @@ -60,12 +56,15 @@ group = 'org.hyperledger.besu' defaultTasks 'build', 'checkLicense', 'javadoc' -def buildAliases = ['dev': [ +def buildAliases = [ + 'dev': [ 'spotlessApply', 'build', 'checkLicense', 'javadoc' - ]] + ], + 'build': ['spotlessCheck', 'build'] +] def expandedTaskList = [] gradle.startParameter.taskNames.each { @@ -436,12 +435,6 @@ allprojects { options.addStringOption('Xwerror', '-html5') options.encoding = 'UTF-8' } - - plugins.withType(JavaPlugin) { - tasks.withType(JavaCompile) { - it.dependsOn(rootProject.tasks.named('spotlessCheckFast')) - } - } } task deploy() {} @@ -465,7 +458,7 @@ task checkMavenCoordinateCollisions { tasks.register('checkPluginAPIChanges', DefaultTask) {} checkPluginAPIChanges.dependsOn(':plugin-api:checkAPIChanges') -check.dependsOn('checkPluginAPIChanges', 'checkMavenCoordinateCollisions', 'spotlessCheckFast') +check.dependsOn('checkPluginAPIChanges', 'checkMavenCoordinateCollisions') subprojects {