Skip to content

Commit 2c866be

Browse files
dsavvinovh0tk3y
authored andcommitted
Add jvm attribute to detached configuration
Otherwise variant-aware resolution fails to find compatible variant in kotlinx-coroutines-core
1 parent ccd1333 commit 2c866be

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

integration-testing/build.gradle

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
2+
13
/*
24
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
35
*/
@@ -60,9 +62,15 @@ task mavenTest(type: Test) {
6062
classpath = sourceSet.runtimeClasspath
6163
// we can't depend on the subprojects because we need to test the classfiles that are published in the end.
6264
// also, we can't put this in the `dependencies` block because the resolution would happen before publication.
63-
classpath += project.configurations.detachedConfiguration(
65+
def mavenTestClasspathConfiguration = project.configurations.detachedConfiguration(
6466
project.dependencies.create("org.jetbrains.kotlinx:kotlinx-coroutines-core:$version"),
6567
project.dependencies.create("org.jetbrains.kotlinx:kotlinx-coroutines-android:$version"))
68+
69+
mavenTestClasspathConfiguration.attributes {
70+
attribute(KotlinPlatformType.attribute, KotlinPlatformType.jvm)
71+
}
72+
73+
classpath += mavenTestClasspathConfiguration
6674
}
6775

6876
task debugAgentTest(type: Test) {

0 commit comments

Comments
 (0)