From c199468ab551f1ad0828c260e9fa319f927a6c8f Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Wed, 4 Jul 2012 10:20:32 +0300 Subject: [PATCH] update schema task --- build.gradle | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 0222e8d3..cd6bf88c 100644 --- a/build.gradle +++ b/build.gradle @@ -157,22 +157,18 @@ task schemaZip(type: Zip) { it.path.endsWith('META-INF' + File.separator + 'spring.schemas') }?.withInputStream { schemas.load(it) } - ext.paths = [] as Set - for (def key : schemas.keySet()) { def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1') + def alias = key.replaceAll(/http.*schema.(.*).(spring-.*)/, '$2') assert shortName != key File xsdFile = sourceSets.main.resources.find { it.path.replace('\\', '/').endsWith(schemas.get(key)) } assert xsdFile != null - def input = xsdFile.path - - if (!paths.contains(input)) { - paths.add(input) - into (shortName) { - from input - } + + into (shortName) { + from xsdFile.path + rename { String fileName -> alias } } } }