Skip to content

Commit 81570df

Browse files
committed
Enable HMPP conditionally for Kotlin 1.4.x and not 1.3.7x
1 parent 382df0f commit 81570df

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44
import org.jetbrains.kotlin.konan.target.HostManager
5+
import org.gradle.util.VersionNumber
56

67
apply plugin: 'jdk-convention'
78
apply from: rootProject.file("gradle/experimental.gradle")
@@ -79,6 +80,11 @@ buildscript {
7980

8081
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
8182

83+
// Hierarchical project structures are not fully supported in 1.3.7x MPP, enable conditionally for 1.4.x
84+
if (VersionNumber.parse(kotlin_version) > VersionNumber.parse("1.3.79")) {
85+
ext.set("kotlin.mpp.enableGranularSourceSetsMetadata", "true")
86+
}
87+
8288
// todo:KLUDGE: This is needed to workaround dependency resolution between Java and MPP modules
8389
def configureKotlinJvmPlatform(configuration) {
8490
configuration.attributes.attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm)

gradle.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,7 @@ org.gradle.jvmargs=-Xmx2g
5656
# https://github.com/gradle/gradle/issues/11412
5757
systemProp.org.gradle.internal.publish.checksums.insecure=true
5858

59-
kotlin.mpp.enableGranularSourceSetsMetadata=true
59+
# This is commented out, and the property is set conditionally in build.gradle, because 1.3.71 doesn't work with it.
60+
# Once this property is set by default in new versions or 1.3.71 is dropped, either uncomment or remove this line.
61+
#kotlin.mpp.enableGranularSourceSetsMetadata=true
6062
kotlin.mpp.enableCompatibilityMetadataVariant=true

0 commit comments

Comments
 (0)