From 4e5ae54417bbdf1e2e0f37ae3663151df39a70f4 Mon Sep 17 00:00:00 2001 From: YuDongYing <987425112@qq.com> Date: Tue, 5 Nov 2019 16:44:23 +0800 Subject: [PATCH] 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 --- gradle/docs.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/docs.gradle b/gradle/docs.gradle index 51b51252e86..fd83d77f5f1 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -175,14 +175,14 @@ task schemaZip(type: Zip) { def Properties schemas = new Properties(); module.sourceSets.main.resources.find { - it.path.endsWith("META-INF/spring.schemas") + (it.path.endsWith("META-INF/spring.schemas") || it.path.endsWith("META-INF\\spring.schemas")) }?.withInputStream { schemas.load(it) } for (def key : schemas.keySet()) { def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1') assert shortName != key File xsdFile = module.sourceSets.main.resources.find { - it.path.endsWith(schemas.get(key)) + (it.path.endsWith(schemas.get(key)) || it.path.endsWith(schemas.get(key).replaceAll('\\/','\\\\'))) } assert xsdFile != null into (shortName) {