Build: Extract build cache setup to kotlin-build-gradle-plugin

This commit is contained in:
Vyacheslav Gerasimov
2019-12-04 21:23:26 +03:00
parent 68ce5dbd90
commit 724884513e
5 changed files with 26 additions and 35 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ plugins {
}
group = "org.jetbrains.kotlin"
version = "0.0.4"
version = "0.0.5"
repositories {
mavenCentral()
@@ -0,0 +1,19 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.initialization.Settings
import org.gradle.caching.http.HttpBuildCache
import java.net.URI
fun Settings.setupBuildCache() {
buildCache.local.isEnabled = kotlinBuildProperties.localBuildCacheEnabled
kotlinBuildProperties.buildCacheUrl?.let { remoteCacheUrl ->
buildCache.remote(HttpBuildCache::class.java) { remoteCache ->
remoteCache.url = URI(remoteCacheUrl)
remoteCache.isPush = kotlinBuildProperties.pushToBuildCache
}
}
}