K2-only issue. In an incremental build, sourceSet boundary isn't preserved in certain conditions: SourceSet A depends on SourceSet B A and B overload a function, for example: A -> fun foo(p: Parent) // (1) B -> fun foo(c: Child) // (2) If some source file in A is calling foo(..), only (1) is supposed to be visible for that call site. However, if a) it is an incremental build, b) the declaration of (1) is not a part of the compilation set, and c) call to foo(c: Child) is applicable, then (2) would be called from the generated code. So, the build result is not consistent between the full build and an incremental build. As a workaround, we fallback to a non-incremental build, if any source from A needs to be compiled. To enable "risky" incremental builds, use Gradle property kotlin.internal.incremental.enableUnsafeOptimizationsForMultiplatform=true ^KT-62686 ^KT-63837 Fixed Merge-request: KT-MR-13695 Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
Kotlin Libraries
This part of the project contains the sources of the following libraries:
- kotlin-stdlib, the standard library for Kotlin/JVM, Kotlin/JS and its additional parts for JDK 7 and JDK 8
- kotlin-reflect, the library for full reflection support
- kotlin-test, the library for multiplatform unit testing
- kotlin-annotations-jvm, the annotations to improve types in the Java code to look better when being consumed in the Kotlin code.
These libraries are built as a part of the root Gradle project.
Kotlin Maven Tools
This area of the project is the root for Maven build.
You can work with the maven modules of this maven project in IDEA from the root IDEA project. After importing you'll be able to explore maven projects and run goals directly from IDEA with the instruments on the right sidebar.
Building
Before building this Maven project you need to build and install the required artifacts built with Gradle to the local maven repository, by issuing the following command in the root project:
./gradlew install
Note: on Windows type
gradlewwithout the leading./
This command assembles and puts the artifacts to the local maven repository to be used by the subsequent maven build. See also root ReadMe.md, section "Building".
Then you can build maven artifacts with Maven:
./mvnw install
If your maven build is failing with Out-Of-Memory errors, set JVM options for maven in MAVEN_OPTS environment variable like this:
MAVEN_OPTS="-Xmx2G"