Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace xjc with custom XSD Kotlin code gen #1479

Merged
merged 13 commits into from
Dec 29, 2024

Conversation

antvaset
Copy link
Contributor

  • Add new cql.xsd-kotlin-gen-conventions plugin that runs node Src/js/xsd-kotlin-gen/generate.js.
  • generate.js reads the XSD files and generates Kotlin classes with minimal imports and without annotations. Currently the input XSDs are hardcoded but should be read in from command line args.
  • Add new cql.xjc-temp-conventions plugin which does the same thing as cql.xjc-conventions but skips sourceSets and sourcesJar and outputs the generated Java classes to ...-xjc-temp. This allows us to generate the Kotlin classes in place (in the same package) using the new method and have the original code also made available for comparison.
  • Replace model-jaxb, model-jackson, elm-jaxb, eml-jackson with model-xmlutil and elm-xmlutil which use https://github.com/pdvrieze/xmlutil to read and write XML and JSON.
  • fhir-modelinfo-3.0.1.xml and quickfhir-modelinfo-3.0.1.xml appeared to be broken and the XML deserializer was throwing "Content is not allowed in prolog". This was fixed by re-creating the files.

Copy link

github-actions bot commented Dec 18, 2024

Formatting check succeeded!

@antvaset antvaset requested a review from JPercival December 18, 2024 00:51
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 68.33579% with 215 lines in your changes missing coverage. Please review.

Project coverage is 67.51%. Comparing base (3b912cd) to head (34fc676).
Report is 1 commits behind head on feature-kotlin.

Files with missing lines Patch % Lines
...org/cqframework/cql/cql2elm/model/ModelImporter.kt 40.98% 27 Missing and 9 partials ⚠️
...tlin/org/cqframework/cql/cql2elm/Cql2ElmVisitor.kt 83.00% 17 Missing and 9 partials ⚠️
...tlin/org/cqframework/cql/cql2elm/LibraryManager.kt 13.33% 26 Missing ⚠️
...rg/cqframework/cql/cql2elm/SystemMethodResolver.kt 34.48% 19 Missing ⚠️
.../cqframework/cql/elm/evaluating/SimpleElmEngine.kt 0.00% 17 Missing ⚠️
...tlin/org/cqframework/cql/cql2elm/LibraryBuilder.kt 76.56% 7 Missing and 8 partials ⚠️
...ql/elm/serializing/xmlutil/ElmJsonLibraryReader.kt 52.63% 9 Missing ⚠️
...org/cqframework/cql/elm/visiting/BaseElmVisitor.kt 91.91% 8 Missing ⚠️
...linfo/r1/serializing/xmlutil/XmlModelInfoReader.kt 46.66% 8 Missing ⚠️
...lm/serializing/xmlutil/ElmLibraryReaderProvider.kt 0.00% 7 Missing ⚠️
... and 16 more
Additional details and impacted files
@@                 Coverage Diff                  @@
##             feature-kotlin    #1479      +/-   ##
====================================================
+ Coverage             67.24%   67.51%   +0.26%     
+ Complexity             4883     4862      -21     
====================================================
  Files                   490      485       -5     
  Lines                 28212    28058     -154     
  Branches               5402     5374      -28     
====================================================
- Hits                  18972    18943      -29     
+ Misses                 7012     6925      -87     
+ Partials               2228     2190      -38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JPercival JPercival merged commit 236d5cc into feature-kotlin Dec 29, 2024
3 checks passed
@JPercival JPercival deleted the feature-kotlin-patch branch December 29, 2024 21:21
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
71.5% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants