diff --git a/tools/gradletooling/gradle-plugin/build.gradle.kts b/tools/gradletooling/gradle-plugin/build.gradle.kts index 48ac6b9d..ec04b6e9 100644 --- a/tools/gradletooling/gradle-plugin/build.gradle.kts +++ b/tools/gradletooling/gradle-plugin/build.gradle.kts @@ -31,7 +31,8 @@ dependencies { implementation("net.sf.saxon:Saxon-HE:10.8") // for xslt 3.0 implementation("name.dmaus.schxslt:java:3.1.1") // for modern schematron - implementation("org.xmlresolver:xmlresolver:5.2.3") // for xml catalogues - note that the apache xml-commons resolver is out of date + implementation("name.dmaus.schxslt:schxslt:1.9.5") // force to use more updated schematron than the java wrapper naturally uses - + implementation("org.xmlresolver:xmlresolver:6.0.4") // for xml catalogues - note that the apache xml-commons resolver is out of date implementation("org.javastro.vodsl:vodslparser:0.4.6") //standalone vodsl parser implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.2") @@ -102,7 +103,7 @@ val functionalTest by tasks.registering(Test::class) { tasks.withType().configureEach { useJUnitPlatform() systemProperty("GRADLE_ROOT_FOLDER", projectDir.absolutePath) - systemProperty("GRADLE_BUILD_FOLDER", layout.buildDirectory) + systemProperty("GRADLE_BUILD_FOLDER", layout.buildDirectory.asFile.get().absolutePath) systemProperty("GRADLE_PLUGIN_VERSION", version) testLogging { showStandardStreams = true diff --git a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlValidateTask.kt b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlValidateTask.kt index 7a83d651..91131100 100644 --- a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlValidateTask.kt +++ b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlValidateTask.kt @@ -1,13 +1,10 @@ package net.ivoa.vodml.gradle.plugin import name.dmaus.schxslt.Schematron -import org.gradle.api.DefaultTask import org.gradle.api.file.ArchiveOperations -import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty -import org.gradle.api.file.RegularFileProperty import org.gradle.api.tasks.* -import org.xmlresolver.CatalogResolver +import org.xmlresolver.XMLResolver import org.xmlresolver.ResolverFeature import org.xmlresolver.XMLResolverConfiguration import javax.inject.Inject @@ -41,10 +38,10 @@ import javax.xml.transform.stream.StreamSource config.setFeature(ResolverFeature.PREFER_PUBLIC, false) config.setFeature(ResolverFeature.URI_FOR_SYSTEM, true) // fall through to URI - val catalogResolver = CatalogResolver(config) + val resolver = XMLResolver(config) val transformerFactory = net.sf.saxon.TransformerFactoryImpl() - transformerFactory.uriResolver = org.xmlresolver.Resolver(catalogResolver) + transformerFactory.uriResolver = resolver.getURIResolver() val schematron = Schematron(StreamSource(this::class.java.getResourceAsStream("/xslt/vo-dml-v1.0.sch.xml")), null, transformerFactory, HashMap()) diff --git a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/XSLTTransform.kt b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/XSLTTransform.kt index 84060748..47ac4078 100644 --- a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/XSLTTransform.kt +++ b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/XSLTTransform.kt @@ -7,7 +7,7 @@ import net.sf.saxon.s9api.Serializer import net.sf.saxon.s9api.XdmAtomicValue import org.gradle.api.GradleException import org.slf4j.LoggerFactory -import org.xmlresolver.CatalogResolver +import org.xmlresolver.XMLResolver import org.xmlresolver.ResolverFeature import org.xmlresolver.XMLResolverConfiguration import java.io.File @@ -73,8 +73,8 @@ import javax.xml.transform.stream.StreamSource config.setFeature(ResolverFeature.CATALOG_FILES, listOf(catalog.absolutePath )) } config.setFeature(ResolverFeature.URI_FOR_SYSTEM, false) // don't automatically use URI as system to prevent surprises - val catalogResolver = CatalogResolver(config) - trans.uriResolver = org.xmlresolver.Resolver(catalogResolver) + val resolver = XMLResolver(config) + trans.uriResolver = resolver.getURIResolver() trans.transform(StreamSource(vodmlFile), out) }