From 91863f20e6b7db9aef30fb74c29bc816bd97bc54 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Wed, 22 Jun 2022 09:26:03 +0200 Subject: [PATCH] Revert "[Gradle] Propagate offline mode to Native cinterop" This reverts commit a28884b1 --- .../kotlin/gradle/native/GeneralNativeIT.kt | 45 ------------------- .../compilerRunner/nativeToolRunners.kt | 7 --- 2 files changed, 52 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt index 613101d83944a..756c765362477 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt @@ -1168,51 +1168,6 @@ class GeneralNativeIT : BaseGradleIT() { } } - @Test - fun `check offline mode is propagated to the cinterop`() = with(transformNativeTestProjectWithPluginDsl("native-cinterop")) { - val buildOptions = defaultBuildOptions() - val cinteropTask = ":projectLibrary:cinteropAnotherNumberHost" - - build(cinteropTask, options = buildOptions) { - assertSuccessful() - } - - // Check that --offline works when all the dependencies are already downloaded: - val buildOptionsOffline = buildOptions.copy(freeCommandLineArgs = buildOptions.freeCommandLineArgs + "--offline") - - build("clean", cinteropTask, options = buildOptionsOffline) { - assertSuccessful() - withNativeCommandLineArguments(cinteropTask, toolName = "cinterop") { - assertTrue(it.containsSequentially("-Xoverride-konan-properties", "airplaneMode=true")) - } - } - - // Check that --offline fails when there are no downloaded dependencies: - val customKonanDataDir = tempDir.newFolder("konanOffline") - val buildOptionsOfflineWithCustomKonanDataDir = buildOptionsOffline.copy( - customEnvironmentVariables = buildOptionsOffline.customEnvironmentVariables + - ("KONAN_DATA_DIR" to customKonanDataDir.absolutePath) - ) - - build("clean", cinteropTask, options = buildOptionsOfflineWithCustomKonanDataDir) { - assertFailed() - } - - checkNoDependenciesDownloaded(customKonanDataDir) - - // Check that the compiler is not extracted if it is not cached: - assertTrue(customKonanDataDir.deleteRecursively()) - build( - "clean", cinteropTask, "-Pkotlin.native.version=1.6.20-M1-9999", - options = buildOptionsOfflineWithCustomKonanDataDir - ) { - assertFailed() - assertTasksNotExecuted(listOf(cinteropTask)) - } - - assertFalse(customKonanDataDir.exists()) - } - @Test fun allowToOverrideDownloadUrl() { with(transformNativeTestProjectWithPluginDsl("native-parallel")) { diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/nativeToolRunners.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/nativeToolRunners.kt index 7aef2477c0cb6..87ef98d9a8702 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/nativeToolRunners.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/nativeToolRunners.kt @@ -146,13 +146,6 @@ internal class KotlinNativeCInteropRunner private constructor(project: Project) fun runWithContext(action: () -> Unit) } - override val defaultArguments: List - get() = mutableListOf().apply { - if (project.gradle.startParameter.isOffline) { - addAll(listOf("-Xoverride-konan-properties", "airplaneMode=true")) - } - } - companion object { fun ExecutionContext.run(args: List) { val runner = KotlinNativeCInteropRunner(project)