Skip to content

Commit

Permalink
try to make work with windows
Browse files Browse the repository at this point in the history
the binding files need to be referred to by URLs rather than absolute paths
  • Loading branch information
pahjbo committed Feb 7, 2024
1 parent 499bbb3 commit cc519bb
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion models/ivoa/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 4 additions & 3 deletions tools/gradletooling/gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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") {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class ExternalModelHelper constructor (private val project: Project, private val
""".trimIndent()
)
v.forEach {
out.write(" <uri name=\"${it.name}\" uri=\"${it.absolutePath}\"/>\n")
out.write(" <uri name=\"${it.name}\" uri=\"${it.toURI().toURL()}\"/>\n")
}
out.write(
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions tools/gradletooling/sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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")
}

Expand Down
6 changes: 3 additions & 3 deletions tools/xslt/jpa.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<xsl:variable name="atv" as="xsd:string*">
<xsl:apply-templates select="$models/key('ellookup',current()/datatype/vodml-ref)" mode="attrovercols"><xsl:with-param name="prefix" select="$name"/></xsl:apply-templates>
</xsl:variable>
<xsl:message><xsl:value-of select="concat('***',$name,'-',$type/name, ' ', name,' overrides --- ',string-join($atv, ' %%%* '))" /></xsl:message>
<!-- <xsl:message><xsl:value-of select="concat('***',$name,'-',$type/name, ' ', name,' overrides -&#45;&#45; ',string-join($atv, ' %%%* '))" /></xsl:message>-->
<xsl:for-each select="$atv">
<xsl:variable name="tmp"> <!-- just to make formatting easier (otherwise each bit is a string seqmnent, and a lot of quotes!) -->
<xsl:variable name="attsubst">
Expand Down Expand Up @@ -257,7 +257,7 @@

<xsl:template match="dataType" mode="attrovercols" as="xsd:string*">
<xsl:param name="prefix" as="xsd:string"/>
<xsl:message>** attrovercolsD <xsl:value-of select="concat(name(),' ',name,' *** ',$prefix)"/></xsl:message>
<!-- <xsl:message>** attrovercolsD <xsl:value-of select="concat(name(),' ',name,' *** ',$prefix)"/></xsl:message>-->
<xsl:for-each select="(attribute, vf:baseTypes(vf:asvodmlref(current()))/attribute)"> <!-- this takes care of dataType inheritance -->
<xsl:variable name="type" select="$models/key('ellookup',current()/datatype/vodml-ref)"/>
<xsl:apply-templates select="$type" mode="attrovercols">
Expand All @@ -273,7 +273,7 @@
<xsl:template match="primitiveType" mode="attrovercols" as="xsd:string*">
<xsl:param name="prefix" as="xsd:string"/>
<xsl:variable name="type" select="$models/key('ellookup',current()/datatype/vodml-ref)"/>
<xsl:message>** attrovercolsP <xsl:value-of select="concat(name(),' ',name,' *** ',$prefix, ' extends=',extends)"/></xsl:message>
<!-- <xsl:message>** attrovercolsP <xsl:value-of select="concat(name(),' ',name,' *** ',$prefix, ' extends=',extends)"/></xsl:message>-->
<xsl:choose>
<xsl:when test="vf:hasMapping(vf:asvodmlref(current()),'java')">
<xsl:variable name="pmap" select="vf:findmapping(vf:asvodmlref(current()),'java')"/>
Expand Down

0 comments on commit cc519bb

Please sign in to comment.