diff --git a/build.gradle b/build.gradle index ad1620b48..62b93d94a 100644 --- a/build.gradle +++ b/build.gradle @@ -178,15 +178,6 @@ subprojects { dependsOn(rootProject.tasks.writeVersion) } - tasks.named("clean") { - doLast { - File sonarDir = new File(buildDir, "sonar-resolver") - if (!sonarDir.exists()) { - sonarDir.mkdirs() - } - } - } - if (name == 'stirling-pdf') { apply plugin: 'org.springdoc.openapi-gradle-plugin' @@ -233,6 +224,21 @@ tasks.withType(JavaCompile).configureEach { def allProjects = ((subprojects as Set) + project) as Set +def ensureSonarResolverDir = { Project proj -> + File sonarDir = new File(proj.buildDir, "sonar-resolver") + if (!sonarDir.exists()) { + sonarDir.mkdirs() + } +} + +configure(allprojects) { + tasks.matching { it.name == "sonarResolver" }.configureEach { + doFirst { + ensureSonarResolverDir(project) + } + } +} + licenseReport { projects = allProjects renderers = [new JsonReportRenderer()]