[Gradle] Don't resolve Apple-specific Cinterops on Linux & Windows
Resolving such dependencies was lenient, however it produced a lot of annoying error messages in the IDE. Because "file not found". KGP already warns user if they are declared Apple-specific targets on non-macos machine. ^KT-66514 Verification Pending
This commit is contained in:
committed by
Space Team
parent
e2336e1752
commit
a56dc7d73a
+10
-2
@@ -99,13 +99,21 @@ class MppIdeDependencyResolutionIT : KGPBaseTest() {
|
||||
|
||||
resolveIdeDependencies("dep-with-cinterop") { dependencies ->
|
||||
dependencies["commonMain"].cinteropDependencies()
|
||||
.assertMatches(binaryCoordinates(Regex("a:dep.*\\(linux_arm64, linux_x64\\)")))
|
||||
.assertMatches(binaryCoordinates(Regex("a:dep.*\\(ios_x64, linux_arm64, linux_x64\\)")))
|
||||
dependencies["commonTest"].cinteropDependencies()
|
||||
.assertMatches(binaryCoordinates(Regex("a:dep.*\\(linux_arm64, linux_x64\\)")))
|
||||
.assertMatches(binaryCoordinates(Regex("a:dep.*\\(ios_x64, linux_arm64, linux_x64\\)")))
|
||||
dependencies["linuxX64Main"].cinteropDependencies().assertMatches(binaryCoordinates(Regex("a:dep.*linux_x64")))
|
||||
dependencies["linuxArm64Main"].cinteropDependencies().assertMatches(binaryCoordinates(Regex("a:dep.*linux_arm64")))
|
||||
dependencies["linuxX64Test"].cinteropDependencies().assertMatches(binaryCoordinates(Regex("a:dep.*linux_x64")))
|
||||
dependencies["linuxArm64Test"].cinteropDependencies().assertMatches(binaryCoordinates(Regex("a:dep.*linux_arm64")))
|
||||
|
||||
val iosX64MainDependencies = dependencies["iosX64Main"].cinteropDependencies()
|
||||
if (HostManager.hostIsMac) {
|
||||
iosX64MainDependencies.assertMatches(binaryCoordinates(Regex("a:dep.*ios_x64")))
|
||||
} else {
|
||||
if (iosX64MainDependencies.isNotEmpty())
|
||||
fail("Expected no dependencies (resolved & unresolved) for iosX64Cinterops on non-MacOS Host")
|
||||
}
|
||||
}
|
||||
|
||||
resolveIdeDependencies("client-for-binary-dep") { dependencies ->
|
||||
|
||||
+1
@@ -6,6 +6,7 @@ plugins {
|
||||
kotlin {
|
||||
linuxX64().compilations.getByName("main").cinterops.create("dep")
|
||||
linuxArm64().compilations.getByName("main").cinterops.create("dep")
|
||||
iosX64().compilations.getByName("main").cinterops.create("dep")
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
Reference in New Issue
Block a user