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

Migrate Stringifiers to Kotlin #806

Merged
merged 13 commits into from
Nov 4, 2023
Merged

Conversation

alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Nov 3, 2023

This PR:

  • Transforms the utility Java class Stringifiers to Kotlin object, adding convenience extension functions to it.
  • Adds stringify() method per Simplify Stringifier.toString call in Java #799.
  • Updates the dependency on Protobuf to version 3.25.0. See note on this below.

Updated usage of protobuf dependency

Version 3.25.0 of Protobuf added .proto files to com.google.protobuf:protobuf-kotlin artifact. Now .proto files are available from both com.google.protobuf:protobuf-java and the Kotlin artifact.

We used to add all the Protobuf libraries to the protobuf dependency for simplicity. SInce only one library (protobuf-java) had .proto source code, it did not cause any problems, until the 3.25.0 update.

The solution is to pass only protobuf-java to the protobuf dependency.

Other changes

  • The Text class was deprecated in favor of the Spine Text library.
  • Iterable.joinByLines() Kotlin ext. fun was introduced to be used instead of Joiner on System.lineSeparator() wherever possible.
  • Top-level Kotlin functions were added to provide idiomatic syntax when using Stringifiers.

Also:
  * Add inline ext. fun.
  * Add `stringify` alias fun for static imports in Java (resolves #799).
@alexander-yevsyukov alexander-yevsyukov self-assigned this Nov 3, 2023
Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Merging #806 (85213a4) into master (3c0eb04) will decrease coverage by 0.10%.
The diff coverage is 87.09%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #806      +/-   ##
============================================
- Coverage     74.64%   74.55%   -0.10%     
+ Complexity     1144     1129      -15     
============================================
  Files           180      180              
  Lines          4205     4189      -16     
  Branches        335      335              
============================================
- Hits           3139     3123      -16     
  Misses          938      938              
  Partials        128      128              

@alexander-yevsyukov alexander-yevsyukov marked this pull request as draft November 3, 2023 17:27
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review November 3, 2023 18:25
@alexander-yevsyukov alexander-yevsyukov merged commit 702d265 into master Nov 4, 2023
6 of 7 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the join-backticked-ext branch November 4, 2023 15:47
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