From 4ebfa2c804d72d19746cdf8d5e25682831dce5c4 Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Thu, 17 Aug 2023 15:45:45 +0100 Subject: [PATCH 1/3] Use lazy API to configure rncToXsd task This avoids configuring the task eagerly. --- config/spring-security-config.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/spring-security-config.gradle b/config/spring-security-config.gradle index 365f08753e..6f897d4a8b 100644 --- a/config/spring-security-config.gradle +++ b/config/spring-security-config.gradle @@ -1,4 +1,5 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import trang.RncToXsd apply plugin: 'io.spring.convention.spring-module' apply plugin: 'trang' @@ -109,7 +110,7 @@ dependencies { testRuntimeOnly 'org.hsqldb:hsqldb' } -rncToXsd { +tasks.named('rncToXsd', RncToXsd).configure { rncDir = file('src/main/resources/org/springframework/security/config/') xsdDir = rncDir xslFile = new File(rncDir, 'spring-security.xsl') From 620e6e0c34fd4d9e9be522e4cdee81015e923127 Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Fri, 18 Aug 2023 16:26:17 +0100 Subject: [PATCH 2/3] Add rncToXsd task to resources set This addresses a deprecation warning causing build caching to be disabled for some tasks. With this change, we tell Gradle that the rncToXsd task produces output that should be considered a resource. This clears up ambiguities when computing the task graph. --- config/spring-security-config.gradle | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/spring-security-config.gradle b/config/spring-security-config.gradle index 6f897d4a8b..e6be0cabe9 100644 --- a/config/spring-security-config.gradle +++ b/config/spring-security-config.gradle @@ -116,6 +116,14 @@ tasks.named('rncToXsd', RncToXsd).configure { xslFile = new File(rncDir, 'spring-security.xsl') } +sourceSets { + main { + resources { + srcDir(tasks.named('rncToXsd')) + } + } +} + tasks.withType(KotlinCompile).configureEach { kotlinOptions { languageVersion = "1.3" @@ -125,8 +133,6 @@ tasks.withType(KotlinCompile).configureEach { } } -build.dependsOn rncToXsd - compileTestJava { exclude "org/springframework/security/config/annotation/web/configurers/saml2/**", "org/springframework/security/config/http/Saml2*" } From f026e2977102836a06ef9d50a77f8b1a2fb7c878 Mon Sep 17 00:00:00 2001 From: Eric Haag Date: Fri, 18 Aug 2023 10:35:46 -0500 Subject: [PATCH 3/3] Add dependency on rncToXsd task from nohttp This addresses a deprecation warning causing build caching to be disabled for the checkstyleNohttp task. With this change, we tell Gradle that the rncToXsd task in the spring-security-config project produces output that should be considered when running the checkstyleNohttp task. This clears up ambiguities when computing the task graph. --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 9aa170a727..1a086bd96f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ import io.spring.gradle.IncludeRepoTask +import trang.RncToXsd buildscript { dependencies { @@ -189,7 +190,7 @@ if (hasProperty('buildScan')) { nohttp { source.exclude "buildSrc/build/**" - + source.builtBy(project(':spring-security-config').tasks.withType(RncToXsd)) } tasks.register('cloneSamples', IncludeRepoTask) {