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 JVM target to use KMP #507

Merged
merged 20 commits into from
Mar 20, 2024

Conversation

krzema12
Copy link
Contributor

@krzema12 krzema12 commented Feb 2, 2024

No description provided.

@krzema12
Copy link
Contributor Author

krzema12 commented Mar 4, 2024

I have to drop working on this, sorry! Feel free to take over.

@westnordost
Copy link

Could you summarize what is still missing in this PR? Do you think it would require adjustments in snakeyaml-engine-kmp itself?

@krzema12
Copy link
Contributor Author

krzema12 commented Mar 4, 2024

@westnordost for sure the JVM-specific API, not sure what more. I recall not being able to get past some failures in unit tests. If some changes are needed in snakeyaml-engine-kmp, I'm the owner of it, so I'll be glad to help. Not sure if any changes will be needed.

@aSemy
Copy link
Contributor

aSemy commented Mar 6, 2024

I've picked this up and I've managed to get the existing tests passing 🎉.

@krzema12 Would you be able to merge these PRs?

Convert jvm to use kmp: implement reading/writing from Java input/output streams
krzema12 pushed a commit to krzema12/snakeyaml-engine-kmp that referenced this pull request Mar 7, 2024
Improvements for MarkedYamlEngineException, for use by Kaml in
charleskorn/kaml#507

- make 'problem' required (matches existing usages)
- make context/problems properties (they are used by Kaml)
- fix problem/context order of ScannerException in ScannerImpl
@krzema12
Copy link
Contributor Author

krzema12 commented Mar 7, 2024

Awesome, thanks @aSemy! Next step, on me: release snakeyaml-engine-kmp with your fix so that we can use it in this PR.

@krzema12
Copy link
Contributor Author

krzema12 commented Mar 7, 2024

https://github.com/krzema12/snakeyaml-engine-kmp/releases/tag/v2.7.2

@edit: I think the release is broken, see https://repo.maven.apache.org/maven2/it/krzeminski/snakeyaml-engine-kmp-js/2.7.2/ - almost no artifacts. That's why CI fails. I'm gonna try again.

@krzema12 krzema12 marked this pull request as ready for review March 7, 2024 15:09
@krzema12 krzema12 changed the title Convert JVM to use KMP Convert JVM target to use KMP Mar 7, 2024
@krzema12 krzema12 requested a review from charleskorn March 13, 2024 20:02
@krzema12
Copy link
Contributor Author

@charleskorn could you review please?

Copy link
Owner

@charleskorn charleskorn left a comment

Choose a reason for hiding this comment

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

Sorry for the slow response to this, I've been a bit busy!

Thanks for working on this, this looks good overall.

build.gradle.kts Show resolved Hide resolved
src/commonMain/kotlin/com/charleskorn/kaml/Yaml.kt Outdated Show resolved Hide resolved
src/commonMain/kotlin/com/charleskorn/kaml/Yaml.kt Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

Regarding the disabled JS tests:

        browser {
            testTask {
                // TODO: enable once the tests work with Kotlin/JS.
                enabled = false
            }
        }
        nodejs {
            testTask {
                // TODO: enable once the tests work with Kotlin/JS.
                enabled = false
            }
        }

I've implemented a workaround in Kotest, so nested tests should work.

kotest/kotest#3913

So, please +1 and review that PR :)

@charleskorn
Copy link
Owner

Thanks for the PR @krzema12 and @aSemy!

@charleskorn charleskorn merged commit 24e1c02 into charleskorn:main Mar 20, 2024
1 check passed
@westnordost
Copy link

Very cool, thanks for your work on this, @krzema12 and @aSemy !

@aSemy aSemy deleted the convert-jvm-to-use-kmp branch April 26, 2024 23:56
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.

4 participants