Skip to content

Commit f694401

Browse files
y987425112sbrannen
authored andcommitted
Fix schemaZip Gradle task on MS Windows
Prior to this commit, the schemaZip Gradle task failed to find Spring schema files on MS Windows due to path separators hard coded to forward slashes that are not compatible with the Windows operating system. Consequently, a full build failed on Windows since the distZip task was not able to locate the zipped schema archive that the schemaZip task failed to create. This commit fixes this by updating the schemaZip task to search for schema files using backslashes as well as forward slashes. Closes gh-23933
1 parent d0506bc commit f694401

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,14 +1273,14 @@ configure(rootProject) {
12731273
def Properties schemas = new Properties();
12741274

12751275
subproject.sourceSets.main.resources.find {
1276-
it.path.endsWith("META-INF/spring.schemas")
1276+
(it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas"))
12771277
}?.withInputStream { schemas.load(it) }
12781278

12791279
for (def key : schemas.keySet()) {
12801280
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
12811281
assert shortName != key
12821282
File xsdFile = subproject.sourceSets.main.resources.find {
1283-
it.path.endsWith(schemas.get(key))
1283+
(it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\')))
12841284
}
12851285
assert xsdFile != null
12861286
into (shortName) {

0 commit comments

Comments
 (0)