Skip to content

Commit 7a82842

Browse files
author
Sergey Chelombitko
committed
Align default cache state with Gradle
1 parent f28eb21 commit 7a82842

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

marathon-gradle-plugin/src/main/kotlin/com/malinskiy/marathon/CachePluginConfiguration.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ interface RemoteCacheExtension {
4141
}
4242

4343
internal fun CachePluginConfiguration.initDefaults() {
44-
local.enabled.convention(false)
44+
local.enabled.convention(true)
4545
local.removeUnusedEntriesAfterDays.convention(7)
46-
remote.enabled.convention(false)
46+
remote.enabled.convention(true)
4747
remote.push.convention(true)
4848
}
4949

@@ -54,14 +54,14 @@ internal fun CachePluginConfiguration.toCacheConfiguration(): CacheConfiguration
5454
)
5555

5656
private fun LocalCacheExtension.toConfig(): LocalCacheConfiguration =
57-
if (enabled.get()) {
57+
if (directory.isPresent && enabled.get()) {
5858
LocalCacheConfiguration.Enabled(directory.get().asFile, removeUnusedEntriesAfterDays.get())
5959
} else {
6060
LocalCacheConfiguration.Disabled
6161
}
6262

6363
private fun RemoteCacheExtension.toConfig(): RemoteCacheConfiguration =
64-
if (enabled.get()) {
64+
if (url.isPresent && enabled.get()) {
6565
RemoteCacheConfiguration.Enabled(
6666
url = url.get(),
6767
credentials = credentials.orNull?.toCredentials(),

0 commit comments

Comments
 (0)