What Is Kotlin Multiplatform?
Kotlin Multiplatform does not attempt to act as a replacement for an existing framework. Instead, it allows you to share Kotlin code across multiple platforms. Codebases that use Kotlin Multiplatform typically have several source code sets (that is, groups of code that are all part of the same project). Your new project will have four source sets:
-
common code
-
JVM
-
macOS
-
JavaScript
The majority of your code will live in your common source set. When you compile for a specific target, the compiler will combine the common code with that platform’s code. So, for example, if you compile for macOS you will get the common code and the macOS code. The relationship between the source sets and the output ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access