From 239f5cb2744822695e5e298affc27dac95480acc Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Tue, 12 Dec 2023 15:17:47 +0100 Subject: [PATCH] build: Publish Gradle buildscans when CI variable is non-empty (#316) This should allow for periodic tracking of improvements (or regressions) in the build performance. Fixes #314 --- settings.gradle.kts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/settings.gradle.kts b/settings.gradle.kts index 76ae589ce..a61454ee9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,6 +17,22 @@ dependencyResolutionManagement { } } +plugins { + id("com.gradle.enterprise") version "3.16" +} + +val isCiBuild = !System.getenv("CI").isNullOrBlank() + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + isUploadInBackground = !isCiBuild + tag(if (isCiBuild) "CI" else "Local") + publishAlwaysIf(isCiBuild) + } +} + enableFeaturePreview("STABLE_CONFIGURATION_CACHE") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")