7/2/2023 0 Comments Klib windows![]() In the commonMain/kotlin directory, create the 64 package.Ĭreate the Base64.kt file in the new package.ĭefine the Base64Encoder interface that converts bytes to the Base64 format: The wizard will create a sample multiplatform library with the following structure: Write cross-platform codeĭefine the classes and interfaces you are going to implement in the common code. If necessary, specify dependencies between modules: Choose the target.Ĭonfigure target settings, such as the target JVM version and test framework. To add target platforms, select library and click the + icon. To add modules, select Project and click the + icon. Specify the JDK, which is required for developing Kotlin projects.įor more complex projects, you might need to add more modules and targets: In the left-hand panel, select Kotlin Multiplatform.Įnter a project name, then in the Multiplatform section select Library as the project template.īy default, your project will use Gradle with Kotlin DSL as the build system. In IntelliJ IDEA, select File | New | Project. Download and install the latest version of IntelliJ IDEA with the latest Kotlin plugin. You can complete this tutorial on any operating system. You will also test your code using common tests, and then publish the library to your local Maven repository. You will use different ways to implement the conversion to the Base64 format on different platforms:įor Kotlin/Native – your own implementation. ![]() It can be used on Kotlin/JVM, Kotlin/JS, and any available Kotlin/Native platform. This library converts raw data – strings and byte arrays – to the Base64 format. In this tutorial, you will learn how to create a multiplatform library for JVM, JS, and Native platforms, write common tests for all platforms, and publish the library to a local Maven repository. Create and publish a multiplatform library – tutorial ![]()
0 Comments
Leave a Reply. |