From 7a82842d39954af4fa660721ee08f6007688b293 Mon Sep 17 00:00:00 2001 From: Sergey Chelombitko Date: Wed, 18 Dec 2024 15:03:56 +0000 Subject: [PATCH] Align default cache state with Gradle --- .../com/malinskiy/marathon/CachePluginConfiguration.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/CachePluginConfiguration.kt b/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/CachePluginConfiguration.kt index 3c9309b46..1a4313dcb 100644 --- a/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/CachePluginConfiguration.kt +++ b/marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/CachePluginConfiguration.kt @@ -41,9 +41,9 @@ interface RemoteCacheExtension { } internal fun CachePluginConfiguration.initDefaults() { - local.enabled.convention(false) + local.enabled.convention(true) local.removeUnusedEntriesAfterDays.convention(7) - remote.enabled.convention(false) + remote.enabled.convention(true) remote.push.convention(true) } @@ -54,14 +54,14 @@ internal fun CachePluginConfiguration.toCacheConfiguration(): CacheConfiguration ) private fun LocalCacheExtension.toConfig(): LocalCacheConfiguration = - if (enabled.get()) { + if (directory.isPresent && enabled.get()) { LocalCacheConfiguration.Enabled(directory.get().asFile, removeUnusedEntriesAfterDays.get()) } else { LocalCacheConfiguration.Disabled } private fun RemoteCacheExtension.toConfig(): RemoteCacheConfiguration = - if (enabled.get()) { + if (url.isPresent && enabled.get()) { RemoteCacheConfiguration.Enabled( url = url.get(), credentials = credentials.orNull?.toCredentials(),