At the core of Kotlin multiplatform is shared code. To start building our project, we'll begin by creating a new Gradle module that will contain our shared Kotlin code:
- First, we'll create a new, empty Gradle project within IntelliJ. When we're finished, we should have a project structure that looks similar to the following:
root .gradle/ .idea/ gradle/ build.gradle gradlew gradlew.bat settings.gradle
- We now want to update build.gradle so that we can define classpath dependencies, which will be needed by other modules. The resulting build.gradle file should look something like this:
buildscript { ext { kotlin_version = '1.3.31' } repositories { google() jcenter() mavenCentral() } dependencies { classpath ...