Add settings convention for Gradle enterprise

This commit is contained in:
Yahor Berdnikau
2023-02-09 15:03:32 +01:00
committed by Space Team
parent b7f50aeaf2
commit 920f76b9ef
11 changed files with 96 additions and 61 deletions
+1 -2
View File
@@ -135,8 +135,7 @@ dependencies {
implementation("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.0.1")
implementation("org.gradle:test-retry-gradle-plugin:1.5.1")
compileOnly("com.gradle:gradle-enterprise-gradle-plugin:3.11.2")
compileOnly("com.gradle:gradle-enterprise-gradle-plugin:3.12.3")
compileOnly(gradleApi())
+1
View File
@@ -17,6 +17,7 @@ pluginManagement {
plugins {
id "build-cache"
id "gradle-enterprise"
}
File versionPropertiesFile = new File(rootProject.projectDir.parentFile, "gradle/versions.properties")
@@ -281,9 +281,7 @@ fun Project.configureTests() {
// Aggregate task for build related checks
tasks.register("checkBuild")
afterEvaluate {
apply(from = "$rootDir/gradle/testRetry.gradle.kts")
}
configureTestRetriesForTestTasks()
}
// TODO: migrate remaining modules to the new JVM default scheme.
+23
View File
@@ -0,0 +1,23 @@
/*
* Copyright 2010-2023 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.Project
import org.gradle.api.tasks.testing.Test
import com.gradle.enterprise.gradleplugin.testretry.retry
import org.gradle.kotlin.dsl.withType
fun Project.configureTestRetriesForTestTasks() {
val testRetryMaxRetries = findProperty("kotlin.build.testRetry.maxRetries")
?.toString()?.toInt()
?: (if (kotlinBuildProperties.isTeamcityBuild) 3 else 0)
tasks.withType<Test>().configureEach {
retry {
maxRetries.set(testRetryMaxRetries)
maxFailures.set(20)
failOnPassedAfterRetry.set(false)
}
}
}