stevedlawrence opened a new pull request, #1173: URL: https://github.com/apache/daffodil-vscode/pull/1173
The resource generator in build.sbt currently extracts all schemas from the daffodil-lib jar and uses xjc to generate JAXB code that allows reading and writing TDML files. Note that this includes the large and complex XML schema for DFDL because that schema is referenced and used by the TDML schema to support embedded DFDL schemas and configurations. However, because the XML Schema for DFDL is so large and complex, it requires special xjc bindings, and also generates java that is not deterministic, making reproducible builds difficult. Fortunately, VS Code doesn't really care about embedded schemas in TDML files--it really only uses JAXB for modifying TDML test cases. So it does not need the many JAXB generated classes that cause the above issues related to embedded schemas. To avoid generating these classes, after the TDML schema is extracted, an XSLT is run to replace the embedded DFDL schema and configuration complex types with "any" elements. This prevents xjc from generating special types for embedded schemas and configurations, instead generating code that just treats them as generic XML Objects. This is sufficient for VS Code uses. Additionally, this allows us to only extract tdml.xsd from daffodil-lib since that is the only schema we need now. We can also remove the bindings.xjb file needed only for the no longer used XML Schema for DFDL. Also changes how we get the TDML namespace for the DocumentPart element, something with this changed how namespaces work. It looks like JAXB no longers maintain namespace declarations. This also moves the resource generator into the xjc/sources task. The two tasks actually ran in parallel and so could lead to a situation where the resource generator hadn't completed when xjc/sources was accessed and led to inconsistent results. The XSD files are really resources anyways, so this is probably the more accurate way to handle this. Additinoally, caching is added so we aren't constant extrating generating JAXB files--instead we only generate if daffodil-lib changes, which should be rare. Closes #1142 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
