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

Convert cql-to-elm to Kotlin Multiplatform (Kotlin feature branch) #1495

Merged
merged 11 commits into from
Feb 3, 2025

Conversation

antvaset
Copy link
Contributor

@antvaset antvaset commented Feb 2, 2025

What's included:

  • The cql-to-elm module is converted to Kotlin Multiplatform.
  • Kotlin version bumped to 2.0 (kotlin.uuid.Uuid only available since Kotlin 2.0).
  • Shim implementations for Stack, isLeapYear, isDigit, isLetter, isLetterOrDigit.
  • java.util.regex.Pattern replaced with kotlin.text.Regex.
  • CqlCompiler, CqlTranslator, LibraryManager, ModelManager, LibrarySourceLoader are split into Common* and JVM-specific subclasses and subinterfaces.
  • A simple @JsExport-friendly CQL-to-ELM helper (can be used to compile CQL to ELM in JS):
cqlToElm(
    cqlText: String,
    getModelXml: (
        id: String,
        system: String?,
        version: String?
    ) -> String,
    getLibraryCql: (
        id: String,
        system: String?,
        version: String?
    ) -> String? = { _, _, _ -> null },
    validateUnit: (unit: String) -> String? = { null },
    outputContentType: String = LibraryContentType.JSON.mimeType()
): String

@antvaset antvaset changed the title Convert cql-to-elm to Kotlin Multiplatform Convert cql-to-elm to Kotlin Multiplatform (Kotlin feature branch) Feb 2, 2025
Copy link

github-actions bot commented Feb 2, 2025

Formatting check succeeded!

Copy link

codecov bot commented Feb 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.70%. Comparing base (61ea9a5) to head (0104561).
Report is 55 commits behind head on feature-kotlin.

Additional details and impacted files
@@                 Coverage Diff                  @@
##             feature-kotlin    #1495      +/-   ##
====================================================
- Coverage             66.02%   61.70%   -4.33%     
+ Complexity             3001     1826    -1175     
====================================================
  Files                   486      334     -152     
  Lines                 28447    14108   -14339     
  Branches               5463     2878    -2585     
====================================================
- Hits                  18782     8705   -10077     
+ Misses                 7467     3971    -3496     
+ Partials               2198     1432     -766     

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

@antvaset antvaset marked this pull request as ready for review February 2, 2025 23:19
Copy link

sonarqubecloud bot commented Feb 2, 2025

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@JsExport
fun cqlToElm(
cqlText: String,
getModelXml: (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice workaround for ServiceLoaders

@JPercival JPercival merged commit 09e43c2 into feature-kotlin Feb 3, 2025
5 of 7 checks passed
@JPercival JPercival deleted the feature-kotlin-multiplatform-cql-to-elm branch February 3, 2025 16:44
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