Skip to content

Commit

Permalink
SONARGO-82 Add "artifactory-configuration" to common Gradle modules
Browse files Browse the repository at this point in the history
  • Loading branch information
petertrr committed Dec 17, 2024
1 parent 675a404 commit 9c39bda
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 180 deletions.
1 change: 1 addition & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ build_task:
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
DEPLOY_PULL_REQUEST: "true"
FORCE_SIGNING: "true"
build_script:
- git submodule update --init --depth 1 -- build-logic
- source cirrus-env BUILD
Expand Down
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-82
177 changes: 0 additions & 177 deletions build.gradle

This file was deleted.

50 changes: 50 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* SonarSource Go
* Copyright (C) 2018-2024 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the Sonar Source-Available License Version 1, as published by SonarSource SA.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the Sonar Source-Available License for more details.
*
* You should have received a copy of the Sonar Source-Available License
* along with this program; if not, see https://sonarsource.com/license/ssal/
*/
plugins {
id("org.sonarsource.cloud-native.code-style-conventions")
id("org.sonarsource.cloud-native.artifactory-configuration")
id("org.sonarqube") version "6.0.1.5171"
}

artifactoryConfiguration {
buildName = "sonar-go"
artifactsToPublish = "org.sonarsource.slang:sonar-go-plugin:jar"
artifactsToDownload = ""
repoKeyEnv = "ARTIFACTORY_DEPLOY_REPO"
usernameEnv = "ARTIFACTORY_DEPLOY_USERNAME"
passwordEnv = "ARTIFACTORY_DEPLOY_PASSWORD"
}

spotless {
java {
// no Java sources in the root project
target("")
}
}

val projectTitle = properties["projectTitle"] as String
sonar {
properties {
property("sonar.organization", "sonarsource")
property("sonar.projectKey", "SonarSource_sonar-go")
property("sonar.projectName", projectTitle)
property("sonar.links.ci", "https://cirrus-ci.com/github/SonarSource/sonar-go")
property("sonar.links.scm", "https://github.com/SonarSource/sonar-go")
property("sonar.links.issue", "https://jira.sonarsource.com/browse/SONARGO")
property("sonar.exclusions", "**/build/**/*")
}
}
17 changes: 15 additions & 2 deletions sonar-go-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import java.util.jar.JarInputStream
plugins {
id("org.sonarsource.cloud-native.java-conventions")
id("org.sonarsource.cloud-native.code-style-conventions")
id("org.sonarsource.cloud-native.artifactory-configuration")
id("com.github.johnrengelman.shadow") version "7.1.0"
}

Expand Down Expand Up @@ -117,8 +118,20 @@ artifacts {
archives(tasks.shadowJar)
}

tasks.artifactoryPublish {
skip = false
artifactoryConfiguration {
pomName = properties["projectTitle"] as String
scmUrl = "https://github.com/SonarSource/sonar-go"

license {
name = "SSALv1"
url = "https://sonarsource.com/license/ssal/"
distribution = "repo"
}

buildName = "sonar-go"
repoKeyEnv = "ARTIFACTORY_DEPLOY_REPO"
usernameEnv = "ARTIFACTORY_DEPLOY_USERNAME"
passwordEnv = "ARTIFACTORY_DEPLOY_PASSWORD"
}

publishing {
Expand Down
7 changes: 7 additions & 0 deletions sonar-go-to-slang/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ tasks.build {
dependsOn(generateTestReport)
}

spotless {
java {
// No Java sources in this project
target("")
}
}

if (System.getenv("CI") == "true") {
// spotless is enabled only for CI, because spotless relies on Go installation being available on the machine
spotless {
Expand Down

0 comments on commit 9c39bda

Please sign in to comment.