Skip to content

Commit

Permalink
Use gradle.properties as version catalog for increased consistency wi…
Browse files Browse the repository at this point in the history
…th other projects
  • Loading branch information
schnapster committed Dec 24, 2024
1 parent 3413110 commit f6bbaf7
Showing 3 changed files with 36 additions and 73 deletions.
49 changes: 25 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -7,13 +7,14 @@ buildscript {
}

plugins {
id 'idea'
id 'java'
alias(libs.plugins.gitprops)
alias(libs.plugins.spring)
id 'jacoco'
alias(libs.plugins.sonar)
alias(libs.plugins.versions)
id "idea"
id "java"
id "com.gorylenko.gradle-git-properties" version "$gradleGitPluginVersion"
id "com.github.ben-manes.versions" version "$versionsPluginVersion"
id "org.springframework.boot" version "$springBootVersion"

id "jacoco"
id "org.sonarqube" version "$sonarqubePluginVersion"
}

group 'space.npstr.baymax'
@@ -37,27 +38,27 @@ configurations {
}

dependencies {
implementation platform(libs.spring.boot.bom)
testRuntimeOnly platform(libs.spring.boot.bom)

implementation libs.jda
implementation libs.logback
implementation libs.sentry
implementation libs.sentry.spring.starter
implementation libs.snakeyaml
implementation libs.caffeine
implementation libs.emojis
implementation libs.guava
implementation libs.sqlite
implementation libs.flyway
implementation platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
testRuntimeOnly platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion")

implementation "net.dv8tion:JDA:$jdaVersion"
implementation "ch.qos.logback:logback-classic"
implementation "io.sentry:sentry-logback:$sentryVersion"
implementation "io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion"
implementation "org.yaml:snakeyaml"
implementation "com.github.ben-manes.caffeine:caffeine"
implementation "com.vdurmont:emoji-java:$emojiVersion"
implementation "com.google.guava:guava:$guavaVersion"
implementation "org.xerial:sqlite-jdbc"
implementation "org.flywaydb:flyway-core"

//spring
implementation libs.spring.boot.starter
implementation "org.springframework.boot:spring-boot-starter"

//testing
testImplementation libs.junit.api
testRuntimeOnly libs.junit.engine
testRuntimeOnly libs.junit.launcher
testImplementation "org.junit.jupiter:junit-jupiter-api"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}

dependencyUpdates.resolutionStrategy {
11 changes: 11 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -3,3 +3,14 @@ org.gradle.warning.mode=all
# Remove again with v5 where it becomes the default
# See https://community.sonarsource.com/t/sonarscanner-for-gradle-you-can-now-decide-when-to-compile
systemProp.sonar.gradle.skipCompile=true

springBootVersion=[3.4.0, 3.5[

gradleGitPluginVersion=[2.4, 3.0[
versionsPluginVersion=0.+
sonarqubePluginVersion=[6.0.1.5171, 7.0[

jdaVersion=[5.2.1, 5.3[
sentryVersion=[7.0.0, 8.0[
emojiVersion=[5.1.1, 6.0[
guavaVersion=[33.0.0-jre, 34[
49 changes: 0 additions & 49 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -6,52 +6,3 @@ pluginManagement {
}

rootProject.name = 'baymax'

ext {
//@formatter:off

//plugin versions
gradleGitVersion = '[2.4, 3.0['
springBootVersion = '[3.4.0, 3.5['
sonarqubeVersion = '[6.0.1.5171, 7.0['
versionsVersion = '0.+'

jdaVersion = '[5.2.1, 5.3['
sentryVersion = '[7.0.0, 8.0['
emojiVersion = '[5.1.1, 6.0['
guavaVersion = '[33.0.0-jre, 34['

//@formatter:on
}

dependencyResolutionManagement {

versionCatalogs {
libs {
version("spring-boot", "$springBootVersion")

plugin("gitprops", "com.gorylenko.gradle-git-properties").version("$gradleGitVersion")
plugin("spring", "org.springframework.boot").version("$springBootVersion")
plugin("sonar", "org.sonarqube").version("$sonarqubeVersion")
plugin("versions", "com.github.ben-manes.versions").version("$versionsVersion")

library("spring-boot-bom", "org.springframework.boot", "spring-boot-dependencies").versionRef("spring-boot")
library("jda", "net.dv8tion:JDA:$jdaVersion")
library("logback", "ch.qos.logback", "logback-classic").withoutVersion()
library("sentry", "io.sentry:sentry-logback:$sentryVersion")
library("sentry-spring-starter", "io.sentry:sentry-spring-boot-starter-jakarta:$sentryVersion")
library("snakeyaml", "org.yaml", "snakeyaml").withoutVersion()
library("caffeine", "com.github.ben-manes.caffeine", "caffeine").withoutVersion()
library("emojis", "com.vdurmont:emoji-java:$emojiVersion")
library("guava", "com.google.guava:guava:$guavaVersion")
library("sqlite", "org.xerial", "sqlite-jdbc").withoutVersion()
library("flyway", "org.flywaydb", "flyway-core").withoutVersion()

library("spring-boot-starter", "org.springframework.boot", "spring-boot-starter").withoutVersion()

library("junit-api", "org.junit.jupiter", "junit-jupiter-api").withoutVersion()
library("junit-engine", "org.junit.jupiter", "junit-jupiter-engine").withoutVersion()
library("junit-launcher", "org.junit.platform", "junit-platform-launcher").withoutVersion()
}
}
}

0 comments on commit f6bbaf7

Please sign in to comment.