From ccd155c84dc78c084790baa08d0a5536fe246f3f Mon Sep 17 00:00:00 2001 From: Peter Trifanov Date: Mon, 16 Dec 2024 15:20:21 +0100 Subject: [PATCH 1/3] SONARGO-83 Create a settings plugin to set project version --- .gitmodules | 1 + build-logic | 2 +- build.gradle | 7 ------- settings.gradle.kts | 35 +---------------------------------- 4 files changed, 3 insertions(+), 42 deletions(-) diff --git a/.gitmodules b/.gitmodules index 73aed1c5..23a706cd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,4 @@ [submodule "build-logic"] path = build-logic url = https://github.com/SonarSource/cloud-native-gradle-modules + branch = SONARGO-83 diff --git a/build-logic b/build-logic index a2bbe6c8..99fe1da9 160000 --- a/build-logic +++ b/build-logic @@ -1 +1 @@ -Subproject commit a2bbe6c8d29755b7d6d147dc4fff391a76177ad6 +Subproject commit 99fe1da93bbdab11232596ead3753053e44f2165 diff --git a/build.gradle b/build.gradle index 031e14c9..34e142db 100644 --- a/build.gradle +++ b/build.gradle @@ -13,19 +13,12 @@ allprojects { apply plugin: 'signing' ext { - buildNumber = System.getProperty("buildNumber") - sonarLinksCi = 'https://cirrus-ci.com/github/SonarSource/sonar-go' sonarLinksScm = 'https://github.com/SonarSource/sonar-go' artifactsToPublish = '' artifactsToDownload = '' } - // Replaces the version defined in sources, usually x.y-SNAPSHOT, by a version identifying the build. - if (version.endsWith('-SNAPSHOT') && ext.buildNumber != null) { - def versionSuffix = (version.toString().count('.') == 1 ? ".0.${ext.buildNumber}" : ".${ext.buildNumber}") - version = version.replace('-SNAPSHOT', versionSuffix) - } repositories { mavenLocal() diff --git a/settings.gradle.kts b/settings.gradle.kts index 423fd47c..852c7e5d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,42 +1,9 @@ pluginManagement { includeBuild("build-logic") - repositories { - mavenCentral() - gradlePluginPortal() - } } plugins { - id("com.gradle.develocity") version "3.18.2" - id("com.diffplug.blowdryerSetup") version "1.7.1" -} - -develocity { - server = "https://develocity.sonar.build" - buildScan { - tag(if (System.getenv("CI").isNullOrEmpty()) "local" else "CI") - tag(System.getProperty("os.name")) - if (System.getenv("CIRRUS_BRANCH") == "master") { - tag("master") - } - if (System.getenv("CIRRUS_PR")?.isBlank() == false) { - tag("PR") - } - value("Build Number", System.getenv("BUILD_NUMBER")) - value("Branch", System.getenv("CIRRUS_BRANCH")) - value("PR", System.getenv("CIRRUS_PR")) - } -} - -val isCI = System.getenv("CI") != null -buildCache { - local { - isEnabled = !isCI - } - remote(develocity.buildCache) { - isEnabled = true - isPush = isCI - } + id("org.sonarsource.cloud-native.common-settings") } rootProject.name = "sonar-go" From 6703ef28044a6e43b6f24b216418e9d58d703fee Mon Sep 17 00:00:00 2001 From: Peter Trifanov Date: Tue, 17 Dec 2024 10:28:53 +0100 Subject: [PATCH 2/3] Update common modules --- build-logic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-logic b/build-logic index 99fe1da9..f46eaf10 160000 --- a/build-logic +++ b/build-logic @@ -1 +1 @@ -Subproject commit 99fe1da93bbdab11232596ead3753053e44f2165 +Subproject commit f46eaf103a2cbf050fe3abf054254503717d773b From 4c22eba5c264c565cd8569903f1423f8f4d4dbcd Mon Sep 17 00:00:00 2001 From: Peter Trifanov Date: Tue, 17 Dec 2024 10:37:13 +0100 Subject: [PATCH 3/3] Update common modules --- .gitmodules | 1 - build-logic | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 23a706cd..73aed1c5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,4 +13,3 @@ [submodule "build-logic"] path = build-logic url = https://github.com/SonarSource/cloud-native-gradle-modules - branch = SONARGO-83 diff --git a/build-logic b/build-logic index f46eaf10..f06117a4 160000 --- a/build-logic +++ b/build-logic @@ -1 +1 @@ -Subproject commit f46eaf103a2cbf050fe3abf054254503717d773b +Subproject commit f06117a4b95ed46c71f9219b0a2fe6f4fef54c8a