Skip to content

Commit 8e65834

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 64db939 commit 8e65834

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
@@ -149,14 +149,14 @@ task schemaZip(type: Zip) {
149149
def Properties schemas = new Properties();
150150

151151
subproject.sourceSets.main.resources.find {
152-
it.path.endsWith("META-INF/spring.schemas")
152+
(it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas"))
153153
}?.withInputStream { schemas.load(it) }
154154

155155
for (def key : schemas.keySet()) {
156156
def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
157157
assert shortName != key
158158
File xsdFile = subproject.sourceSets.main.resources.find {
159-
it.path.endsWith(schemas.get(key))
159+
(it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\')))
160160
}
161161
assert xsdFile != null
162162
into (shortName) {

0 commit comments

Comments
 (0)