Skip to content

Commit

Permalink
Align default cache state with Gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Chelombitko committed Dec 18, 2024
1 parent f28eb21 commit 7a82842
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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(),
Expand Down

0 comments on commit 7a82842

Please sign in to comment.