Skip to content

Fix breaking builds on Native due to depending on serialization #109

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

Closed
wants to merge 3 commits into from

Conversation

dkhalanskyjb
Copy link
Collaborator

Looks like compileOnly doesn't, in fact, ensure that there is no
runtime dependency, as Kotlin/Native does not support that. Thus,
it looks like compileOnly transforms into something like api in
a contrived manner, which leads to the tests implicitly acquiring
a runtime dependency.

Therefore, the changes:

  • There is now a separate artifact for serialization.
  • The datetime classes are no longer marked as @Serializable and
    don't have default serializers.
  • The package name for serializers is now
    "kotlinx.datetime.serialization", as it makes sense for it to be
    similar to the name of the artifact, and an artifact with the
    name "serializers" would look odd.

Looks like `compileOnly` doesn't, in fact, ensure that there is no
runtime dependency, as Kotlin/Native does not support that. Thus,
it looks like `compileOnly` transforms into something like `api` in
a contrived manner, which leads to the tests implicitly acquiring
a runtime dependency.

Therefore, the changes:
* There is now a separate artifact for serialization.
* The datetime classes are no longer marked as @serializable and
  don't have default serializers.
* The package name for serializers is now
  "kotlinx.datetime.serialization", as it makes sense for it to be
  similar to the name of the artifact, and an artifact with the
  name "serializers" would look odd.
@dkhalanskyjb dkhalanskyjb requested a review from ilya-g April 21, 2021 12:42
@DRSchlaubi
Copy link

DRSchlaubi commented Apr 21, 2021

But that also means that you now always have to put a @contextual above any kx.datetime property

@dkhalanskyjb
Copy link
Collaborator Author

Closed in favor of #110

@dkhalanskyjb dkhalanskyjb deleted the fix-serialization branch April 23, 2021 09:03
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