Skip to content

Commit 4e5ae54

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 7646895 commit 4e5ae54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gradle/docs.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ task schemaZip(type: Zip) {
175175
def Properties schemas = new Properties();
176176

177177
module.sourceSets.main.resources.find {
178-
it.path.endsWith("META-INF/spring.schemas")
178+
(it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas"))
179179
}?.withInputStream { schemas.load(it) }
180180

181181
for (def key : schemas.keySet()) {
182182
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
183183
assert shortName != key
184184
File xsdFile = module.sourceSets.main.resources.find {
185-
it.path.endsWith(schemas.get(key))
185+
(it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\')))
186186
}
187187
assert xsdFile != null
188188
into (shortName) {

0 commit comments

Comments
 (0)