Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONARGO-83 Create a settings plugin to set project version #46

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
[submodule "build-logic"]
path = build-logic
url = https://github.com/SonarSource/cloud-native-gradle-modules
branch = SONARGO-83
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

7 changes: 0 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
35 changes: 1 addition & 34 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Loading