Skip to content

Commit

Permalink
Upgrade gradle to 7.6.2
Browse files Browse the repository at this point in the history
Upgrading gradle solved the dependency issue on the sonarqube step on the cicd pipeline.
  • Loading branch information
DiegoTavares committed Sep 26, 2024
1 parent 39d96fa commit 7a9b97a
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 209 deletions.
1 change: 0 additions & 1 deletion .github/workflows/testing-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,5 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
chown -R aswfuser:aswfgroup .
cuebot/gradlew dependencies
su -c "cd cuebot && ./gradlew jacocoTestReport sonar -Dsonar.login=$(SONAR_TOKEN)" aswfuser
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ htmlcov/
.vscode
.venv/
.eggs/*
.gradle/*
/cuebot/logs
/cuebot/bin
/logs
118 changes: 49 additions & 69 deletions cuebot/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.2.1.RELEASE'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.8'
}
plugins {
id 'java'
id('eclipse')
id('idea')
id('org.springframework.boot') version "2.2.1.RELEASE"
id('io.spring.dependency-management') version "1.1.4"
id('com.google.protobuf') version "0.9.1"
id('jacoco')
id('org.sonarqube') version "2.8"
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.google.protobuf'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'

sourceCompatibility = 11
targetCompatibility = 11

Expand All @@ -31,6 +17,7 @@ ext {
}

configurations {
testCompile
compile.exclude module: 'spring-boot-starter-logging'
}

Expand All @@ -39,49 +26,53 @@ repositories {
jcenter()
}

def grpcVersion = '1.47.0'
def protobufVersion = '3.21.2'

// Spring dependency versions are managed by the io.spring.dependency-management plugin.
// Appropriate versions will be pulled based on the spring boot version specified in the
// spring-boot-gradle-plugin.
dependencies {
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
compile group: 'com.google.guava', name: 'guava', version: '26.0-android'
compile group: 'com.sun.mail', name: 'mailapi', version: '1.5.4'
compile group: 'commons-lang', name: 'commons-lang', version: '2.6'
compile group: 'io.grpc', name: 'grpc-all', version: '1.47.0'
compile group: 'org.apache.activemq', name: 'activemq-pool', version: activemqVersion
compile group: 'org.apache.velocity', name: 'velocity', version: '1.7'
compile group: 'org.jdom', name: 'jdom', version: '1.1.3'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web'
compile group: 'org.springframework', name: 'spring-context-support'
compile group: 'org.springframework', name: 'spring-jms'
compile group: 'org.quartz-scheduler', name: 'quartz', version: '2.2.1', { exclude group: 'c3p0', module: 'c3p0' }
compile group: 'org.postgresql', name: 'postgresql', version: '42.2.2'
compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.21.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.16.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.16.0'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.16.0'
compile group: 'io.sentry', name: 'sentry-log4j2', version: '7.11.0'
compile group: 'io.prometheus', name: 'simpleclient', version: '0.16.0'
compile group: 'io.prometheus', name: 'simpleclient_servlet', version: '0.16.0'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
implementation group: 'com.google.guava', name: 'guava', version: '26.0-android'
implementation group: 'com.sun.mail', name: 'mailapi', version: '1.5.4'
implementation group: 'commons-lang', name: 'commons-lang', version: '2.6'
implementation group: 'io.grpc', name: 'grpc-all', version: "${grpcVersion}"
implementation group: 'org.apache.activemq', name: 'activemq-pool', version: activemqVersion
implementation group: 'org.apache.velocity', name: 'velocity', version: '1.7'
implementation group: 'org.jdom', name: 'jdom', version: '1.1.3'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
implementation group: 'org.springframework', name: 'spring-context-support'
implementation group: 'org.springframework', name: 'spring-jms'
implementation group: 'org.quartz-scheduler', name: 'quartz', version: '2.2.1', { exclude group: 'c3p0', module: 'c3p0' }
implementation group: 'org.postgresql', name: 'postgresql', version: '42.2.2'
implementation group: 'com.google.protobuf', name: 'protobuf-java', version: "${protobufVersion}"
implementation group: 'log4j', name: 'log4j', version: '1.2.17'
implementation group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.26'
implementation group: 'io.sentry', name: 'sentry-log4j2', version: '7.11.0'
implementation group: 'io.prometheus', name: 'simpleclient', version: '0.16.0'
implementation group: 'io.prometheus', name: 'simpleclient_servlet', version: '0.16.0'

protobuf fileTree("../proto/")

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.8.0'
testCompile group: 'io.zonky.test', name: 'embedded-postgres', version: '1.3.1'
testCompile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.8.0'
testImplementation group: 'io.zonky.test', name: 'embedded-postgres', version: '1.3.1'
testImplementation group: 'org.flywaydb', name: 'flyway-core', version: '5.2.0'

// Use newer version of Postgres for tests: https://github.com/zonkyio/embedded-postgres/issues/78
implementation enforcedPlatform('io.zonky.test.postgres:embedded-postgres-binaries-bom:11.13.0')
}

compileJava {
dependsOn generateProto
options.compilerArgs << "-Xlint:all" << "-Werror"
}

compileTestJava {
dependsOn generateProto
options.compilerArgs << "-Xlint:all" << "-Werror"
}

Expand All @@ -93,7 +84,7 @@ protobuf {
plugins {
grpc {
// Generate gRPC stubs.
artifact = 'io.grpc:protoc-gen-grpc-java:1.47.0'
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
Expand All @@ -118,12 +109,16 @@ sourceSets {
}
}

jar {
enabled = true
}

bootJar {
baseName = 'cuebot'
}

jacoco {
toolVersion = "0.8.12"
toolVersion = "0.8.11"
}

jacocoTestReport {
Expand Down Expand Up @@ -175,25 +170,10 @@ tasks.withType(AbstractArchiveTask) {
reproducibleFileOrder = true
}

tasks.withType(Test) {
// Configure logging when running Gradle with --info or --debug.
test {
testLogging {
info {
// Don't show STANDARD_OUT messages, these clutter up the output
// and make it hard to find actual failures.
events TestLogEvent.FAILED
exceptionFormat TestExceptionFormat.FULL
showStandardStreams false
}
debug {
// Show everything.
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
testLogging {
exceptionFormat = 'full'
}
}
}
Binary file modified cuebot/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions cuebot/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Nov 26 18:34:57 PST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
Loading

0 comments on commit 7a9b97a

Please sign in to comment.