Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From now on we officially™ support Kotlin API of JavaThemis on Android and desktop JVM.
It was possible to use JavaThemis via Kotlin before but we were not sure in the API we provided and we not guaranteeing its stability. Now we do.
User notes
API stability and maturity
All existing Kotlin API is now considered stable. That is, we will do our best to avoid breaking it and if there is a need to deprecate some parts of Kotlin API, you will be notified about that.
SecureCell
APIs are considered mature for Kotlin. That is, we are happy with this API in Kotlin and will not update it unless absolutely necessary.As of JavaThemis 0.13, other APIs are not yet mature for Kotlin. We will not break these APIs, but you might expect some new, improved APIs to appear and some APIs to be deprecated in later releases, until Kotlin API has stabilized and matured.
Java 1.7 is minimum target for apps, Java 1.8 is needed for compilation
The minimum target for applications using JavaThemis or AndroidThemis is still Java 1.7.
If you get JavaThemis from Maven, you can still use Java 1.7 to compile your applications.
However, JavaThemis now requires Java 1.8 or later for compilation from source. This is the requirement of Kotlin compiler.
Technical notes
We are using the latest current version of Kotlin: 1.3.72. Kotlin is used only for tests. JavaThemis does not and will not require Kotlin at runtime for applications.
Since Kotlin supports lambdas out of the box, a polyfill for
org.junit.Assert#assertThrows
is added. It makes exception testing much more readable.The tests themselves were automatically converted from Java code by IntelliJ, they are basically the same. Though, they did require some manual cleanup after that.
We currently test only
SecureCell
in Kotlin. Other cryptosystems will require additional review which is out of scope for Themis 0.13. We will get back to them in next releases.Checklist
Benchmark results are attached(nope, not right now)Example projects and code samples are up-to-date(we don't have Kotlin examples, maybe later)