Skip to content

Commit

Permalink
SONARGO-52 Create a new repository for common Gradle scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
petertrr committed Dec 12, 2024
1 parent 7e4becb commit 3fc4fa8
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 23 deletions.
7 changes: 5 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ build_task:
SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
DEPLOY_PULL_REQUEST: "true"
build_script:
- git submodule update --init --depth 1 -- build-logic
- source cirrus-env BUILD
- function gradle(){ ./gradlew "$@"; }; export -f gradle
- gradle --version
Expand Down Expand Up @@ -138,6 +139,7 @@ ws_scan_task:
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
whitesource_script:
- git submodule update --init --depth 1 -- build-logic
- source cirrus-env QA
- ./gradlew --no-daemon --console plain clean
- ./gradlew --no-daemon --info --stacktrace --console plain --no-daemon build -x test
Expand All @@ -158,11 +160,12 @@ promote_task:
<<: *ONLY_IF_SONARSOURCE_QA
eks_container:
<<: *CONTAINER_DEFINITION
cpu: 1
memory: 1G
cpu: 2
memory: 2G
env:
ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token]
GITHUB_TOKEN: VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promotion token]
promote_script:
- git submodule update --init --depth 1 -- build-logic
- function gradle(){ ./gradlew "$@"; }; export -f gradle
- cirrus_promote_gradle multi
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
[submodule "its/sources/kubernetes-client-go"]
path = its/sources/kubernetes-client-go
url = https://github.com/kubernetes/client-go
[submodule "build-logic"]
path = build-logic
url = https://github.com/SonarSource/cloud-native-gradle-modules
branch = SONARGO-52
1 change: 1 addition & 0 deletions build-logic
Submodule build-logic added at ee1ab0
16 changes: 0 additions & 16 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ subprojects {

apply plugin: 'com.diffplug.spotless'

java.sourceCompatibility = JavaVersion.VERSION_17
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = java.sourceCompatibility.majorVersion as int
}

jacoco {
toolVersion = "0.8.7"
}
Expand Down Expand Up @@ -115,16 +109,6 @@ subprojects {
}
}

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

// license updater
spotless {
java {
Expand Down
4 changes: 4 additions & 0 deletions its/plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.sonarsource.cloud-native.java-conventions")
}

dependencies {
testImplementation libs.sonar.analyzer.commons
testImplementation testLibs.sonar.ws
Expand Down
4 changes: 4 additions & 0 deletions its/ruling/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.sonarsource.cloud-native.java-conventions")
}

dependencies {
testImplementation libs.sonar.analyzer.commons
testImplementation testLibs.assertj.core
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pluginManagement {
includeBuild("build-logic")
repositories {
mavenCentral()
gradlePluginPortal()
Expand Down
6 changes: 1 addition & 5 deletions sonar-go-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id("org.sonarsource.cloud-native.java-conventions")
id 'com.github.johnrengelman.shadow' version '7.1.0'
}

Expand Down Expand Up @@ -30,11 +31,6 @@ dependencies {
testRuntimeOnly testLibs.junit.jupiter.engine
}

tasks.withType(JavaCompile) {
// Prevent warning: Gradle 5.0 will ignore annotation processors
options.compilerArgs += [ "-proc:none" ]
}

test {
testLogging {
exceptionFormat 'full' // log the full stack trace (default is the 1st line of the stack trace)
Expand Down

0 comments on commit 3fc4fa8

Please sign in to comment.