Control cache redirector status in test via project settings.
Test will use project `gradle.properties` file to get current cache redirector status, so it could be controlled from one place. ^KT-47185 Fixed
This commit is contained in:
+7
-1
@@ -215,12 +215,18 @@ internal fun Path.enableCacheRedirector() {
|
||||
val gradleDir = resolve("gradle").also { it.createDirectories() }
|
||||
redirectorScript.copyTo(gradleDir.resolve("cacheRedirector.gradle.kts"))
|
||||
|
||||
val projectCacheRedirectorStatus = Paths
|
||||
.get("../../../gradle.properties")
|
||||
.readText()
|
||||
.lineSequence()
|
||||
.first { it.startsWith("cacheRedirectorEnabled") }
|
||||
|
||||
resolve("gradle.properties")
|
||||
.also { if (!it.exists()) it.createFile() }
|
||||
.appendText(
|
||||
"""
|
||||
|
||||
cacheRedirectorEnabled=true
|
||||
$projectCacheRedirectorStatus
|
||||
|
||||
""".trimIndent()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user