r/Kotlin

▲ 28 r/Kotlin+1 crossposts

Kotlin Toolchain will eventually drop Gradle for Android (via Joffrey Bion on Slack)

Someone on the Kotlin Slack asked if the Kotlin Toolchain will ever build Android apps without Gradle

Joffrey Bion (from the JetBrains Kotlin Toolchain team) confirmed that the long-term plan is to drop Gradle entirely and call Android SDK tools directly, though it will take time and help from Google

What runs natively today (No Gradle):

  • SDK provisioning & dependencies
  • Compilation & AAR packaging
  • Unit tests & emulators

What still delegates to Gradle for now:

  • Mockable android.jar (asked Google to decouple this)
  • R class generation
  • APK/AAB packaging (D8/R8, manifests, signing)

Pretty cool that building Android without Gradle is an actual official goal tbh

reddit.com
u/RazerTexz — 11 days ago
▲ 14 r/Kotlin

Prosa.kt - Declarative code generation for Kotlin

I made a declarative API for generating Kotlin code.

I needed it for one of my desktop/browser Compose apps a while ago and noticed there was no KMP solution for Kotlin codegen.

While working on it, I decided to made the API declarative so the generated code was simpler to reason about. This work started before AI was as popular as it is today, so the design of the API was very important.

Fast forward two years: I realized I needed it for another project of mine, so I figured I might as well open-source the codegen part for the community.

And that's how Prosa.kt was born and proudly brought to you.

There’s a live demo on the landing page, so you can try it out directly.

Check it out at https://prosakt.com and give it a star on GitHub because I love vanity metrics.

u/alexstyl — 11 days ago
▲ 0 r/Kotlin

The time has come to separate Kotlin from Java.

I want to use Kotlin, so I have eight different JDKs on my PC; however, Kotlin has reached a point where it can stand as an independent language. To that end, I’ve created my own KRE (Kotlin Run Environment). Now, the next step is the KDK (Kotlin Development Kit), and I need help with that. I don't know Java or Kotlin all that well—is there anyone who can assist?

reddit.com
u/Original_Bee4999 — 12 days ago
▲ 2 r/Kotlin

Which is best kotlin course on udemy or youtube!!?

Hi , i am coming from the JavaScript/TypeScript ecosystem, i need to build a project that must be written in kotlin based backend , i am not primarily interested in Android development.

But I do need to understand Kotlin well enough to read, navigate, and work with existing Kotlin projects, particularly Android applications available on github.

So is there any course or method you can suggest?

Thanks in advance.!!!

reddit.com
u/TomorrowNo8568 — 11 days ago
▲ 14 r/Kotlin+2 crossposts

sqlx4k 1.14.0 released: optimistic locking, savepoints, MariaDB batch inserts

sqlx4k is a coroutine-first SQL toolkit for Kotlin Multiplatform (PostgreSQL, MySQL/MariaDB, SQLite) with compile-time SQL validation via KSP.

New in 1.14.0

  • Optimistic locking with @Version: generated update/delete check the version and fail with OptimisticLockFailed on conflicts. In-memory test repositories behave the same.
  • Transaction savepoints: roll back part of a transaction with a scoped savepoint { ... } block or the explicit savepoint/rollbackToSavepoint/releaseSavepoint calls.
  • MariaDB dialect: batchInsert via multi-row INSERT ... RETURNING (10.5+).
  • Cancellation-safe transactions: cancelling a coroutine mid-transaction now rolls back properly.
  • Kotlin 2.4.20, KSP 2.3.12.

Repo: https://github.com/smyrgeorge/sqlx4k

Release notes: https://github.com/smyrgeorge/sqlx4k/releases/tag/1.14.0

reddit.com
u/smyrgeorge — 12 days ago
▲ 5 r/Kotlin

Uncaught exceptions and Supervisor Jobs

In https://medium.com/androiddevelopers/exceptions-in-coroutines-ce8da1ec060c

It talks about how with a SupervisorJob, you can ignore exceptions from a child coroutine, and it does not propagate to its siblings or to the grand parents and so forth. But then it also says “If the exception is not handled and the CoroutineContext doesn’t have a CoroutineExceptionHandler (as we’ll see later), it will reach the default thread’s ExceptionHandler. In the JVM, the exception will be logged to console; and in Android, it will make your app crash regardless of the Dispatcher this happens on.”

But this sounds like it’s saying the app will just crash and everything will die if the exception is not handled; but then whats the point in saving the coroutine family using a SupervisorJob if everything will just die anyway? If they mean I need to implement the CoroutineExceptionHandler for the SupervisorJob to be of use, then the question is, what is the point of having a SupervisorJob…… cuz then every discussion of SupervisorJob needs to marked with an asterisk * (oh btw, you also need to implement the CoroutineExceptionHandler otherwise your Supervisor is useless. )

And why do they explain these things so off-handedly as if it’s so not confusing at all to someone learning?

u/Horror_Still_3305 — 13 days ago