Build: Extract cache redirector to script & add verification task

This commit is contained in:
Vyacheslav Gerasimov
2019-05-21 20:41:26 +03:00
parent 2bbf92a6c3
commit b88d9d62b8
8 changed files with 255 additions and 114 deletions
+13 -5
View File
@@ -11,9 +11,15 @@ buildscript {
// when updating please also update JPS artifacts configuration: https://jetbrains.quip.com/zzGUAYSJ6gv3/JPS-Build-update-bootstrap
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.50-dev-397", onlySuccessBootstrap = false))
repositories.withRedirector(project) {
repositories {
bootstrapKotlinRepo?.let(::maven)
maven("https://plugins.gradle.org/m2")
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
} else {
maven("https://plugins.gradle.org/m2")
}
}
// a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes
@@ -410,10 +416,12 @@ allprojects {
}
}
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
// Aggregate task for build related checks
tasks.register("checkBuild") {
tasks.findByName("check")?.dependsOn(this)
}
apply(from = "$rootDir/gradle/cacheRedirector.gradle.kts")
}
}