From cc519bb51ba764b85766b70c990cc6a238e882f1 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Wed, 7 Feb 2024 15:22:37 +0000 Subject: [PATCH] try to make work with windows the binding files need to be referred to by URLs rather than absolute paths --- models/ivoa/build.gradle.kts | 2 +- tools/gradletooling/gradle-plugin/build.gradle.kts | 7 ++++--- .../kotlin/net/ivoa/vodml/gradle/plugin/VodmlBaseTask.kt | 2 +- .../kotlin/net/ivoa/vodml/gradle/plugin/VodmlJavaTask.kt | 2 +- .../kotlin/net/ivoa/vodml/gradle/plugin/VodmlPythonTask.kt | 2 +- .../kotlin/net/ivoa/vodml/gradle/plugin/VodmlSiteTask.kt | 2 +- .../kotlin/net/ivoa/vodml/gradle/plugin/VodmlXsdTask.kt | 2 +- tools/gradletooling/sample/build.gradle.kts | 6 +++--- tools/xslt/jpa.xsl | 6 +++--- 9 files changed, 16 insertions(+), 15 deletions(-) diff --git a/models/ivoa/build.gradle.kts b/models/ivoa/build.gradle.kts index d9f3a850..9c61eb87 100644 --- a/models/ivoa/build.gradle.kts +++ b/models/ivoa/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("net.ivoa.vo-dml.vodmltools") version "0.4.2" + id("net.ivoa.vo-dml.vodmltools") version "0.4.3" // id ("com.diffplug.spotless") version "5.17.1" `maven-publish` id("io.github.gradle-nexus.publish-plugin") version "1.3.0" diff --git a/tools/gradletooling/gradle-plugin/build.gradle.kts b/tools/gradletooling/gradle-plugin/build.gradle.kts index 0c6da6c4..4a0ca384 100644 --- a/tools/gradletooling/gradle-plugin/build.gradle.kts +++ b/tools/gradletooling/gradle-plugin/build.gradle.kts @@ -14,7 +14,7 @@ plugins { } group = "net.ivoa.vo-dml" -version = "0.4.2" +version = "0.4.3" repositories { mavenLocal() // FIXME remove this when releasing - just here to pick up local vodsl updates @@ -71,10 +71,11 @@ gradlePlugin { } java { - targetCompatibility = JavaVersion.VERSION_11 + toolchain { + languageVersion.set(JavaLanguageVersion.of(11)) + } } - // Add a source set for the functional test suite val functionalTestSourceSet = sourceSets.create("functionalTest") { } diff --git a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlBaseTask.kt b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlBaseTask.kt index a9701ce7..83410909 100644 --- a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlBaseTask.kt +++ b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlBaseTask.kt @@ -105,7 +105,7 @@ class ExternalModelHelper constructor (private val project: Project, private val """.trimIndent() ) v.forEach { - out.write(" \n") + out.write(" \n") } out.write( """ diff --git a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlJavaTask.kt b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlJavaTask.kt index 8ecfa124..8eacc771 100644 --- a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlJavaTask.kt +++ b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlJavaTask.kt @@ -38,7 +38,7 @@ import javax.inject.Inject val outfile = javaGenDir.file("$shortname.javatrans.txt") Vodml2Java.doTransform( v.absoluteFile, mapOf( - "binding" to allBinding.joinToString(separator = ",") { it.absolutePath }, + "binding" to allBinding.joinToString(separator = ",") { it.toURI().toURL().toString() }, "output_root" to javaGenDir.get().asFile.absolutePath, "isMain" to (if (index++ == 0) "True" else "False") // first is the Main ), diff --git a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlPythonTask.kt b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlPythonTask.kt index 229fdea7..78c327a5 100644 --- a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlPythonTask.kt +++ b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlPythonTask.kt @@ -39,7 +39,7 @@ import javax.inject.Inject val outfile = pythonGenDir.file("$shortname.pythontrans.txt") Vodml2Python.doTransform( v.absoluteFile, mapOf( - "binding" to allBinding.joinToString(separator = ",") { it.absolutePath }, + "binding" to allBinding.joinToString(separator = ",") { it.toURI().toURL().toString() }, "output_root" to pythonGenDir.get().asFile.absolutePath, "isMain" to (if (index++ == 0) "True" else "False") // first is the Main ), diff --git a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlSiteTask.kt b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlSiteTask.kt index 362642c3..94c476c2 100644 --- a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlSiteTask.kt +++ b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlSiteTask.kt @@ -62,7 +62,7 @@ import javax.inject.Inject outfile = docDir.file("$shortname.md") val params = mutableMapOf( "graphviz_png" to docDir.file("$shortname.svg").get().asFile.absolutePath, - "binding" to allBinding.joinToString(separator = ",") { it.absolutePath }, + "binding" to allBinding.joinToString(separator = ",") { it.toURI().toURL().toString() }, ) if (modelsToDocument.isPresent) params["modelsToDocument"] = modelsToDocument.get() Vodml2md.doTransform(it.absoluteFile, params, diff --git a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlXsdTask.kt b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlXsdTask.kt index a6b72a6a..1bc2fa58 100644 --- a/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlXsdTask.kt +++ b/tools/gradletooling/gradle-plugin/src/main/kotlin/net/ivoa/vodml/gradle/plugin/VodmlXsdTask.kt @@ -39,7 +39,7 @@ open class VodmlXsdTask @Inject constructor(ao1: ArchiveOperations) : VodmlBase val outfile = schemaDir.file("$shortname.xsd") logger.info("Generating XML schema from ${it.name} to ${outfile.get().asFile.absolutePath}") Vodml2xsd.doTransform(it.absoluteFile, mapOf( - "binding" to allBinding.joinToString(separator = ",") { it.absolutePath } + "binding" to allBinding.joinToString(separator = ",") { it.toURI().toURL().toString() } ), actualCatalog, outfile.get().asFile) } diff --git a/tools/gradletooling/sample/build.gradle.kts b/tools/gradletooling/sample/build.gradle.kts index eca9a24a..a5b162cf 100644 --- a/tools/gradletooling/sample/build.gradle.kts +++ b/tools/gradletooling/sample/build.gradle.kts @@ -6,7 +6,7 @@ import ru.vyarus.gradle.plugin.python.task.PythonTask * */ plugins { - id("net.ivoa.vo-dml.vodmltools") version "0.4.2" + id("net.ivoa.vo-dml.vodmltools") version "0.4.3" // id ("com.diffplug.spotless") version "5.17.1" id("ru.vyarus.use-python") version "3.0.0" @@ -98,8 +98,8 @@ python { ) pip("pytest:7.3.1") - pip("SQLAlchemy:2.0.16") - pip("xsdata[lxml,cli]:23.5") + pip("SQLAlchemy:2.0.25") + pip("xsdata[lxml,cli]:24.1") pip("pydantic:1.10.9") } diff --git a/tools/xslt/jpa.xsl b/tools/xslt/jpa.xsl index 7c6a8e17..f580fe24 100644 --- a/tools/xslt/jpa.xsl +++ b/tools/xslt/jpa.xsl @@ -227,7 +227,7 @@ - + @@ -257,7 +257,7 @@ - ** attrovercolsD + @@ -273,7 +273,7 @@ - ** attrovercolsP +