Enable JVM IR for stdlib/reflect/test libraries
Changes in Gradle integration tests are needed because: - in new-mpp-android, kotlin-stdlib-jdk8 is used, and JVM IR generates JDK 8-specific bytecode (invokedynamic). D8 needs to be configured to desugar it with source/target versions set to 1.8, otherwise it reports an error. - in AndroidExtensionsManyVariants and AndroidIcepickProject, D8 fails with assertions enabled if AGP < 4.0.0 is used because of https://issuetracker.google.com/issues/148661132. The tests which use old AGP versions are probably not relevant anymore anyway. Changes in kotlin-stdlib-runtime-merged.txt are caused by a slightly different generation scheme of collection subclasses in JVM IR, and are harmless. (Previous attempt was at 15e978dbd311c2ba78ec32b394c21acde9811ccb.)
This commit is contained in:
@@ -80,8 +80,6 @@ class KotlinBuildProperties(
|
|||||||
|
|
||||||
val localBootstrapPath: String? = getOrNull("bootstrap.local.path") as String?
|
val localBootstrapPath: String? = getOrNull("bootstrap.local.path") as String?
|
||||||
|
|
||||||
val useIRForLibraries: Boolean = getBoolean("kotlin.build.useIRForLibraries")
|
|
||||||
|
|
||||||
val useFir: Boolean = getBoolean("kotlin.build.useFir")
|
val useFir: Boolean = getBoolean("kotlin.build.useFir")
|
||||||
|
|
||||||
val useFirForLibraries: Boolean = getBoolean("kotlin.build.useFirForLibraries")
|
val useFirForLibraries: Boolean = getBoolean("kotlin.build.useFirForLibraries")
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ org.gradle.java.installations.fromEnv=JDK_16,JDK_17,JDK_18,JDK_9,JDK_10,JDK_11,J
|
|||||||
cacheRedirectorEnabled=true
|
cacheRedirectorEnabled=true
|
||||||
defaultSnapshotVersion=1.6.255-SNAPSHOT
|
defaultSnapshotVersion=1.6.255-SNAPSHOT
|
||||||
|
|
||||||
# Enable JVM IR backend for kotlin-stdlib, kotlin-reflect, kotlin-test.
|
|
||||||
#kotlin.build.useIRForLibraries=true
|
|
||||||
|
|
||||||
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
||||||
#bootstrap.kotlin.repo=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap
|
#bootstrap.kotlin.repo=https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap
|
||||||
#bootstrap.kotlin.version=1.1.50-dev-1451
|
#bootstrap.kotlin.version=1.1.50-dev-1451
|
||||||
|
|||||||
@@ -64,17 +64,6 @@ ext.configurePluginMarkers = { Project project, withEmptyJars = true ->
|
|||||||
PluginMarkersKt.publishPluginMarkers(project, withEmptyJars)
|
PluginMarkersKt.publishPluginMarkers(project, withEmptyJars)
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.configureJvmIrBackend = { Project project ->
|
|
||||||
project.tasks.withType(KotlinCompile.class) { task ->
|
|
||||||
task.kotlinOptions {
|
|
||||||
if (!project.kotlinBuildProperties.useIRForLibraries) {
|
|
||||||
useIR = false
|
|
||||||
freeCompilerArgs += "-Xuse-old-backend"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects { project ->
|
allprojects { project ->
|
||||||
project.ext.configureSourcesJar = { lambda = {} ->
|
project.ext.configureSourcesJar = { lambda = {} ->
|
||||||
ArtifactsKt.sourcesJar(project) { task ->
|
ArtifactsKt.sourcesJar(project) { task ->
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ compileTestKotlin {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
if (includeJava9) {
|
if (includeJava9) {
|
||||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.junit')
|
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.junit')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ compileTestKotlin {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
if (includeJava9) {
|
if (includeJava9) {
|
||||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.junit5')
|
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.junit5')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ compileTestKotlin {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
if (includeJava9) {
|
if (includeJava9) {
|
||||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test')
|
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,6 @@ compileTestKotlin {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
if (includeJava9) {
|
if (includeJava9) {
|
||||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.testng')
|
LibrariesCommon.configureJava9Compilation(project, 'kotlin.test.testng')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,6 @@ compileKotlin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifestAttributes(manifest, project, "internal")
|
manifestAttributes(manifest, project, "internal")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ compileTestKotlin {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk7')
|
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk7')
|
||||||
|
|
||||||
task testJdk6Tests(type: Test) {
|
task testJdk6Tests(type: Test) {
|
||||||
|
|||||||
@@ -75,8 +75,6 @@ compileTestKotlin {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk8')
|
LibrariesCommon.configureJava9Compilation(project, 'kotlin.stdlib.jdk8')
|
||||||
|
|
||||||
task testJdk6Tests(type: Test) { thisTask ->
|
task testJdk6Tests(type: Test) { thisTask ->
|
||||||
|
|||||||
@@ -143,8 +143,6 @@ compileLongRunningTestKotlin {
|
|||||||
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalStdlibApi"
|
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalStdlibApi"
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|
||||||
task longRunningTest(type: Test, dependsOn: longRunningTestClasses) {
|
task longRunningTest(type: Test, dependsOn: longRunningTestClasses) {
|
||||||
group = "verification"
|
group = "verification"
|
||||||
testClassesDirs = sourceSets.longRunningTest.output.classesDirs
|
testClassesDirs = sourceSets.longRunningTest.output.classesDirs
|
||||||
|
|||||||
+4
-4
@@ -312,7 +312,7 @@ public final class kotlin/UByteArray : java/util/Collection, kotlin/jvm/internal
|
|||||||
public fun removeAll (Ljava/util/Collection;)Z
|
public fun removeAll (Ljava/util/Collection;)Z
|
||||||
public fun retainAll (Ljava/util/Collection;)Z
|
public fun retainAll (Ljava/util/Collection;)Z
|
||||||
public static final fun set-VurrAj0 ([BIB)V
|
public static final fun set-VurrAj0 ([BIB)V
|
||||||
public final fun size ()I
|
public synthetic fun size ()I
|
||||||
public fun toArray ()[Ljava/lang/Object;
|
public fun toArray ()[Ljava/lang/Object;
|
||||||
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
||||||
public fun toString ()Ljava/lang/String;
|
public fun toString ()Ljava/lang/String;
|
||||||
@@ -371,7 +371,7 @@ public final class kotlin/UIntArray : java/util/Collection, kotlin/jvm/internal/
|
|||||||
public fun removeAll (Ljava/util/Collection;)Z
|
public fun removeAll (Ljava/util/Collection;)Z
|
||||||
public fun retainAll (Ljava/util/Collection;)Z
|
public fun retainAll (Ljava/util/Collection;)Z
|
||||||
public static final fun set-VXSXFK8 ([III)V
|
public static final fun set-VXSXFK8 ([III)V
|
||||||
public final fun size ()I
|
public synthetic fun size ()I
|
||||||
public fun toArray ()[Ljava/lang/Object;
|
public fun toArray ()[Ljava/lang/Object;
|
||||||
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
||||||
public fun toString ()Ljava/lang/String;
|
public fun toString ()Ljava/lang/String;
|
||||||
@@ -430,7 +430,7 @@ public final class kotlin/ULongArray : java/util/Collection, kotlin/jvm/internal
|
|||||||
public fun removeAll (Ljava/util/Collection;)Z
|
public fun removeAll (Ljava/util/Collection;)Z
|
||||||
public fun retainAll (Ljava/util/Collection;)Z
|
public fun retainAll (Ljava/util/Collection;)Z
|
||||||
public static final fun set-k8EXiF4 ([JIJ)V
|
public static final fun set-k8EXiF4 ([JIJ)V
|
||||||
public final fun size ()I
|
public synthetic fun size ()I
|
||||||
public fun toArray ()[Ljava/lang/Object;
|
public fun toArray ()[Ljava/lang/Object;
|
||||||
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
||||||
public fun toString ()Ljava/lang/String;
|
public fun toString ()Ljava/lang/String;
|
||||||
@@ -489,7 +489,7 @@ public final class kotlin/UShortArray : java/util/Collection, kotlin/jvm/interna
|
|||||||
public fun removeAll (Ljava/util/Collection;)Z
|
public fun removeAll (Ljava/util/Collection;)Z
|
||||||
public fun retainAll (Ljava/util/Collection;)Z
|
public fun retainAll (Ljava/util/Collection;)Z
|
||||||
public static final fun set-01HTLdE ([SIS)V
|
public static final fun set-01HTLdE ([SIS)V
|
||||||
public final fun size ()I
|
public synthetic fun size ()I
|
||||||
public fun toArray ()[Ljava/lang/Object;
|
public fun toArray ()[Ljava/lang/Object;
|
||||||
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
public fun toArray ([Ljava/lang/Object;)[Ljava/lang/Object;
|
||||||
public fun toString ()Ljava/lang/String;
|
public fun toString ()Ljava/lang/String;
|
||||||
|
|||||||
@@ -27,5 +27,3 @@ compileKotlin {
|
|||||||
]
|
]
|
||||||
kotlinOptions.moduleName = project.name
|
kotlinOptions.moduleName = project.name
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|||||||
-1
@@ -1 +0,0 @@
|
|||||||
org.gradle.jvmargs=-ea -XX:MaxPermSize=512m
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
org.gradle.jvmargs=-ea -XX:MaxPermSize=512m
|
|
||||||
+4
@@ -21,6 +21,10 @@ android {
|
|||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility 1.8
|
||||||
|
targetCompatibility 1.8
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -40,5 +40,3 @@ compileKotlin {
|
|||||||
]
|
]
|
||||||
kotlinOptions.moduleName = project.name
|
kotlinOptions.moduleName = project.name
|
||||||
}
|
}
|
||||||
|
|
||||||
configureJvmIrBackend(project)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user