[Gradle] Implement integration test for KT-54981
^KT-54981 Verification Pending
This commit is contained in:
committed by
Space Team
parent
55ef9a6bad
commit
17c20bff92
+22
-5
@@ -297,6 +297,20 @@ class HierarchicalMppIT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
@DisplayName("KT-54995: compileAppleMainKotlinMetadata fails on default parameters with `No value passed for parameter 'mustExist'")
|
||||
fun testCompileSharedNativeSourceSetWithOKIODependency(gradleVersion: GradleVersion) {
|
||||
project(
|
||||
projectName = "kt-54995-compileSharedNative-with-okio",
|
||||
gradleVersion = gradleVersion
|
||||
) {
|
||||
build("assemble") {
|
||||
assertFileExists(projectPath.resolve("build/libs/test-project-jvm.jar"))
|
||||
assertFileExists(projectPath.resolve("build/classes/kotlin/metadata/nativeMain/klib/test-project_nativeMain.klib"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun publishThirdPartyLib(
|
||||
projectName: String = "third-party-lib".withPrefix,
|
||||
withGranularMetadata: Boolean,
|
||||
@@ -731,9 +745,9 @@ class HierarchicalMppIT : KGPBaseTest() {
|
||||
val iosX64ModuleSources = macOnly { listOf("test/lib-iosx64/1.0/lib-iosx64-1.0-sources.jar") }
|
||||
val iosArm64ModuleSources = macOnly { listOf("test/lib-iosarm64/1.0/lib-iosarm64-1.0-sources.jar") }
|
||||
val allPublishedSources = rootModuleSources +
|
||||
jvmModuleSources + jvm2ModuleSources +
|
||||
linuxX64ModuleSources + linuxArm64ModuleSources +
|
||||
iosX64ModuleSources + iosArm64ModuleSources
|
||||
jvmModuleSources + jvm2ModuleSources +
|
||||
linuxX64ModuleSources + linuxArm64ModuleSources +
|
||||
iosX64ModuleSources + iosArm64ModuleSources
|
||||
|
||||
infix fun Pair<String, List<String>>.and(that: List<String>) = first to (second + that)
|
||||
|
||||
@@ -847,7 +861,8 @@ class HierarchicalMppIT : KGPBaseTest() {
|
||||
@DisplayName("KT-51946: Temporarily mark HMPP tasks as notCompatibleWithConfigurationCache for Gradle 7.4")
|
||||
fun testHmppTasksAreNotIncludedInGradleConfigurationCache(gradleVersion: GradleVersion, @TempDir tempDir: Path) {
|
||||
with(project("hmppGradleConfigurationCache", gradleVersion = gradleVersion, localRepoDir = tempDir)) {
|
||||
val options = buildOptions.copy(configurationCache = true, configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL)
|
||||
val options =
|
||||
buildOptions.copy(configurationCache = true, configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL)
|
||||
|
||||
build(":lib:publish") {
|
||||
assertTasksExecuted(":lib:publish")
|
||||
@@ -873,6 +888,7 @@ class HierarchicalMppIT : KGPBaseTest() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@GradleTest
|
||||
@GradleTestVersions(maxVersion = TestVersions.Gradle.G_7_3)
|
||||
@DisplayName("KT-51946: Print warning on tasks that are not compatible with configuration cache")
|
||||
@@ -885,7 +901,8 @@ class HierarchicalMppIT : KGPBaseTest() {
|
||||
assertOutputDoesNotContain("""Task \S+ is not compatible with configuration cache""".toRegex())
|
||||
}
|
||||
|
||||
val options = buildOptions.copy(configurationCache = true, configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL)
|
||||
val options =
|
||||
buildOptions.copy(configurationCache = true, configurationCacheProblems = BaseGradleIT.ConfigurationCacheProblems.FAIL)
|
||||
buildAndFail("clean", "assemble", buildOptions = options) {
|
||||
assertOutputContains("""Task \S+ is not compatible with configuration cache""".toRegex())
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
plugins {
|
||||
id("org.jetbrains.kotlin.multiplatform")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
linuxX64()
|
||||
mingwX64()
|
||||
|
||||
sourceSets {
|
||||
val commonMain = getByName("commonMain") {
|
||||
dependencies {
|
||||
implementation("com.squareup.okio:okio:3.2.0")
|
||||
}
|
||||
}
|
||||
|
||||
val nativeMain = create("nativeMain") {
|
||||
dependsOn(commonMain)
|
||||
}
|
||||
getByName("linuxX64Main") {
|
||||
dependsOn(nativeMain)
|
||||
}
|
||||
getByName("mingwX64Main") {
|
||||
dependsOn(nativeMain)
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
rootProject.name = "test-project"
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import okio.FileSystem
|
||||
import okio.Path.Companion.toPath
|
||||
|
||||
expect val HostFileSystem: FileSystem
|
||||
|
||||
fun main() {
|
||||
HostFileSystem.delete("toto".toPath())
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import okio.FileSystem
|
||||
|
||||
actual val HostFileSystem: FileSystem
|
||||
get() = FileSystem.SYSTEM
|
||||
|
||||
fun useCommonMain() = main()
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import okio.FileSystem
|
||||
|
||||
actual val HostFileSystem: FileSystem
|
||||
get() = FileSystem.SYSTEM
|
||||
|
||||
fun useCommonMain() = main()
|
||||
Reference in New Issue
Block a user