Skip to content

Commit

Permalink
Merge pull request #44 from OSGP/libs-versions-toml
Browse files Browse the repository at this point in the history
libs versions toml
  • Loading branch information
loesimmens authored Feb 13, 2025
2 parents 426907e + 489bc37 commit 91b0823
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 79 deletions.
14 changes: 7 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SPDX-FileCopyrightText: Copyright Contributors to the GXF project
#
# SPDX-License-Identifier: Apache-2.0
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: "gradle"
directory: "/"
registries: "*"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
10 changes: 4 additions & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright Contributors to the GXF project
#
# SPDX-License-Identifier: Apache-2.0
name: Gradle Pipeline

on:
Expand Down Expand Up @@ -28,12 +31,7 @@ jobs:
with:
dependency-graph: generate-and-submit
- name: Build with Gradle
run: ./gradlew build integrationTest
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run sonar analysis with Gradle
run: ./gradlew testCodeCoverageReport integrationTestCodeCoverageReport sonar
run: ./gradlew build integrationTest testCodeCoverageReport integrationTestCodeCoverageReport sonar
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
24 changes: 12 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URI

plugins {
id("io.spring.dependency-management") version "1.1.7" apply false
kotlin("jvm") version "2.1.10" apply false
kotlin("plugin.spring") version "2.1.10" apply false
id("org.sonarqube") version "6.0.1.5171"
id("com.diffplug.spotless") version("6.25.0")
alias(libs.plugins.dependencyManagement) apply false
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.spring) apply false
alias(libs.plugins.sonarqube)
alias(libs.plugins.spotless)
}

sonar {
Expand All @@ -28,13 +28,13 @@ version = System.getenv("GITHUB_REF_NAME")
?: "develop"

subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.spring")
apply(plugin = "io.spring.dependency-management")
apply(plugin = "org.gradle.maven-publish")
apply(plugin = "jacoco")
apply(plugin = "jacoco-report-aggregation")
apply(plugin = "com.diffplug.spotless")
apply(plugin = rootProject.libs.plugins.kotlin.get().pluginId)
apply(plugin = rootProject.libs.plugins.spring.get().pluginId)
apply(plugin = rootProject.libs.plugins.dependencyManagement.get().pluginId)
apply(plugin = rootProject.libs.plugins.mavenPublish.get().pluginId)
apply(plugin = rootProject.libs.plugins.spotless.get().pluginId)
apply(plugin = rootProject.libs.plugins.jacoco.get().pluginId)
apply(plugin = rootProject.libs.plugins.jacocoReportAggregation.get().pluginId)

group = rootProject.group
version = rootProject.version
Expand Down
44 changes: 44 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# SPDX-FileCopyrightText: Copyright Contributors to the GXF project
#
# SPDX-License-Identifier: Apache-2.0

[versions]
avro = "1.12.0"
avroPlugin = "1.9.1"
dependencyManagement = "1.1.7"
kotlin = "2.1.10"
mockitoKotlin = "5.4.0"
mockServer = "5.15.0"
msal4j = "1.17.2"
sonarqube = "6.0.1.5171"
spotless = "6.25.0"

[libraries]
assertJ = { group = "org.assertj", name = "assertj-core" }
avro = { group = "org.apache.avro", name = "avro", version.ref = "avro" }
junitJupiterApi = { group = "org.junit.jupiter", name = "junit-jupiter-api" }
junitJupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine" }
junitPlatformLauncher = { group = "org.junit.platform", name = "junit-platform-launcher" }
kafkaClients = { group = "org.apache.kafka", name = "kafka-clients" }
mockitoKotlin = { group = "org.mockito.kotlin", name = "mockito-kotlin", version.ref = "mockitoKotlin" }
mockServer = { group = "org.mock-server", name = "mockserver-spring-test-listener", version.ref = "mockServer" }
msal = { group = "com.microsoft.azure", name = "msal4j", version.ref = "msal4j" }
slf4jApi = { group = "org.slf4j", name = "slf4j-api" }
springBootAutoconfigure = { group = "org.springframework.boot", name = "spring-boot-autoconfigure" }
springBootStarter = { group = "org.springframework.boot", name = "spring-boot-starter" }
springBootStarterTest = { group = "org.springframework.boot", name = "spring-boot-starter-test" }
springBootTest = { group = "org.springframework.boot", name = "spring-boot-test" }
springContext = { group = "org.springframework", name = "spring-context" }
springKafka = { group = "org.springframework.kafka", name = "spring-kafka" }
springTest = { group = "org.springframework", name = "spring-test" }

[plugins]
avro = { id = "com.github.davidmc24.gradle.plugin.avro", version.ref = "avroPlugin" }
dependencyManagement = { id = "io.spring.dependency-management", version.ref = "dependencyManagement" }
jacoco = { id = "jacoco" }
jacocoReportAggregation = { id = "jacoco-report-aggregation" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
mavenPublish = { id = "org.gradle.maven-publish" }
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
14 changes: 7 additions & 7 deletions kafka-avro/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import com.github.davidmc24.gradle.plugin.avro.GenerateAvroJavaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("com.github.davidmc24.gradle.plugin.avro") version "1.9.1"
alias(libs.plugins.avro)
}

dependencies {
implementation("org.apache.kafka:kafka-clients")
implementation(libs.kafkaClients)
implementation(libs.avro)

implementation("org.slf4j:slf4j-api")
implementation(libs.slf4jApi)

testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-engine")
testImplementation(libs.junitJupiterApi)
testImplementation(libs.junitJupiterEngine)

testImplementation("org.assertj:assertj-core")
testImplementation(libs.assertJ)

testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly(libs.junitPlatformLauncher)
}

tasks.withType<KotlinCompile> {
Expand Down
12 changes: 6 additions & 6 deletions kafka-azure-oauth/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
dependencies {
implementation("org.apache.kafka:kafka-clients")
implementation(libs.kafkaClients)
implementation(libs.msal)

implementation("org.slf4j:slf4j-api")
implementation(libs.slf4jApi)

testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-engine")
testImplementation(libs.junitJupiterApi)
testImplementation(libs.junitJupiterEngine)

testImplementation("org.assertj:assertj-core")
testImplementation(libs.assertJ)

testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly(libs.junitPlatformLauncher)
}
22 changes: 11 additions & 11 deletions kafka-message-signing/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@
// SPDX-License-Identifier: Apache-2.0

dependencies {
implementation("org.springframework:spring-context")
implementation("org.springframework.kafka:spring-kafka")
implementation("org.springframework.boot:spring-boot-autoconfigure")
implementation(libs.springContext)
implementation(libs.springKafka)
implementation(libs.springBootAutoconfigure)

implementation(project(":kafka-avro"))

api(libs.avro)

testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-engine")
testImplementation("org.assertj:assertj-core")
testImplementation("org.springframework:spring-test")
testImplementation("org.springframework.boot:spring-boot-test")
testImplementation("org.springframework.boot:spring-boot-starter")
testImplementation(testLibs.mockitoKotlin)
testImplementation(libs.junitJupiterApi)
testImplementation(libs.junitJupiterEngine)
testImplementation(libs.assertJ)
testImplementation(libs.springTest)
testImplementation(libs.springBootTest)
testImplementation(libs.springBootStarter)
testImplementation(libs.mockitoKotlin)

testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly(libs.junitPlatformLauncher)
}

tasks.test {
Expand Down
16 changes: 8 additions & 8 deletions oauth-token-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
dependencies{
implementation("org.springframework:spring-context")
implementation(libs.springContext)
api(libs.msal)

testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-engine")
testImplementation(libs.junitJupiterApi)
testImplementation(libs.junitJupiterEngine)

testImplementation("org.springframework:spring-test")
testImplementation(libs.springTest)

testImplementation("org.assertj:assertj-core")
testImplementation(libs.assertJ)

testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly(libs.junitPlatformLauncher)
}

testing {
Expand All @@ -18,8 +18,8 @@ testing {
useJUnitJupiter()
dependencies {
implementation(project())
implementation("org.springframework.boot:spring-boot-starter-test")
implementation(testLibs.mockServer) {
implementation(libs.springBootStarterTest)
implementation(libs.mockServer) {
// CVE fixes
exclude(group = "org.bouncycastle", module = "bcpkix-jdk18on")
exclude(group = "org.bouncycastle", module = "bcprov-jdk18on")
Expand Down
22 changes: 0 additions & 22 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//
// SPDX-License-Identifier: Apache-2.0


plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}
Expand All @@ -12,24 +11,3 @@ include("kafka-azure-oauth")
include("oauth-token-client")
include("kafka-avro")
include("kafka-message-signing")


dependencyResolutionManagement {
versionCatalogs {
create("libs") {
version("avro", "1.12.0")
version("msal4j", "1.17.2")

library("avro", "org.apache.avro", "avro").versionRef("avro")
library("msal", "com.microsoft.azure", "msal4j").versionRef("msal4j")
}

create("testLibs") {
version("mockitoKotlin", "5.4.0")
version("mockServer", "5.15.0")

library("mockitoKotlin", "org.mockito.kotlin", "mockito-kotlin").versionRef("mockitoKotlin")
library("mockServer", "org.mock-server", "mockserver-spring-test-listener").versionRef("mockServer")
}
}
}

0 comments on commit 91b0823

Please sign in to comment.