diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f56ea812..4cbb9f775 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,14 +50,13 @@ jobs: uses: actions/checkout@v4 - name: Setup Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: zulu java-version: 17 - cache: gradle - name: Setup Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v3 - name: Execute Gradle build run: ./gradlew build @@ -78,7 +77,7 @@ jobs: - name: Docker Meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ github.repository }} @@ -93,7 +92,7 @@ jobs: - name: Docker Meta Alpine id: meta-alpine - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ github.repository }} @@ -109,13 +108,13 @@ jobs: type=sha,prefix= - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -123,14 +122,14 @@ jobs: - name: Log in to docker registry if: env.DOCKER_USERNAME && env.DOCKER_TOKEN && env.DOCKER_REGISTRY && env.DOCKER_IMAGE - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ env.DOCKER_USERNAME }} password: ${{ env.DOCKER_TOKEN }} - name: Build Ubuntu and Push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: file: LavalinkServer/docker/Dockerfile context: . @@ -140,7 +139,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Build Alpine and Push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: file: LavalinkServer/docker/alpine.Dockerfile context: . diff --git a/.gitignore b/.gitignore index 703911c04..17558ae6d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ application.yml LavalinkServer/plugins .cache/ site/ -.DS_Store \ No newline at end of file +.DS_Store +.kotlin/ \ No newline at end of file diff --git a/LavalinkServer/build.gradle.kts b/LavalinkServer/build.gradle.kts index c4d3f9649..ddb62b35a 100644 --- a/LavalinkServer/build.gradle.kts +++ b/LavalinkServer/build.gradle.kts @@ -91,7 +91,7 @@ tasks { filter(ReplaceTokens::class, mapOf("tokens" to tokens)) copy { from("application.yml.example") - into("$buildDir/resources/main") + into(layout.buildDirectory.dir("resources/main")) } } diff --git a/build.gradle.kts b/build.gradle.kts index cd938efea..1bb71a69f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,6 +2,7 @@ import com.vanniktech.maven.publish.MavenPublishBaseExtension import com.vanniktech.maven.publish.SonatypeHost import org.ajoberstar.grgit.Grgit import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { id("org.jetbrains.dokka") version "1.8.20" apply false @@ -10,9 +11,9 @@ plugins { id("org.springframework.boot") version "3.1.0" apply false id("org.sonarqube") version "4.2.0.3129" id("com.adarshr.test-logger") version "3.2.0" - id("org.jetbrains.kotlin.jvm") version "1.8.22" - id("org.jetbrains.kotlin.plugin.allopen") version "1.8.22" - id("org.jetbrains.kotlin.plugin.serialization") version "1.8.22" apply false + id("org.jetbrains.kotlin.jvm") version "2.0.0" + id("org.jetbrains.kotlin.plugin.allopen") version "2.0.0" + id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0" apply false alias(libs.plugins.maven.publish.base) apply false } @@ -37,7 +38,7 @@ subprojects { } tasks.withType { - kotlinOptions.jvmTarget = "17" + compilerOptions.jvmTarget = JvmTarget.JVM_17 } tasks.withType { diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties new file mode 100644 index 000000000..858feb7e3 --- /dev/null +++ b/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,2 @@ +#This file is generated by updateDaemonJvm +toolchainVersion=17 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index c1962a79e..e6441136f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 17a8ddce2..a4413138c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index aeb74cbb4..b740cf133 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -130,10 +131,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -141,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac @@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then '' | soft) :;; #( *) # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 + # shellcheck disable=SC2039,SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -198,11 +202,11 @@ fi # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ diff --git a/gradlew.bat b/gradlew.bat index 6689b85be..7101f8e46 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/settings.gradle.kts b/settings.gradle.kts index b573a8e37..beb709cda 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -23,9 +23,9 @@ dependencyResolutionManagement { } fun VersionCatalogBuilder.spring() { - version("spring-boot", "3.1.0") + version("spring-boot", "3.3.0") - library("spring-websocket", "org.springframework", "spring-websocket").version("6.0.9") + library("spring-websocket", "org.springframework", "spring-websocket").version("6.1.9") library("spring-boot", "org.springframework.boot", "spring-boot").versionRef("spring-boot") library("spring-boot-web", "org.springframework.boot", "spring-boot-starter-web").versionRef("spring-boot") @@ -66,16 +66,16 @@ fun VersionCatalogBuilder.metrics() { } fun VersionCatalogBuilder.common() { - version("kotlin", "1.8.22") + version("kotlin", "2.0.0") library("kotlin-reflect", "org.jetbrains.kotlin", "kotlin-reflect").versionRef("kotlin") library("kotlin-stdlib-jdk8", "org.jetbrains.kotlin", "kotlin-stdlib-jdk8").versionRef("kotlin") - library("kotlinx-serialization-json", "org.jetbrains.kotlinx", "kotlinx-serialization-json").version("1.5.1") - library("kotlinx-datetime", "org.jetbrains.kotlinx", "kotlinx-datetime").version("0.4.0") + library("kotlinx-serialization-json", "org.jetbrains.kotlinx", "kotlinx-serialization-json").version("1.7.0") + library("kotlinx-datetime", "org.jetbrains.kotlinx", "kotlinx-datetime").version("0.6.0") - library("logback", "ch.qos.logback", "logback-classic").version("1.4.7") - library("sentry-logback", "io.sentry", "sentry-logback").version("6.22.0") + library("logback", "ch.qos.logback", "logback-classic").version("1.5.6") + library("sentry-logback", "io.sentry", "sentry-logback").version("7.10.0") library("oshi", "com.github.oshi", "oshi-core").version("6.4.11") } @@ -83,7 +83,7 @@ fun VersionCatalogBuilder.other() { library("jda", "net.dv8tion", "JDA").version("4.1.1_135") library("lavalink-client", "com.github.FredBoat", "Lavalink-Client").version("8d9b660") - val mavenPublishPlugin = version("maven-publish-plugin", "0.25.3") + val mavenPublishPlugin = version("maven-publish-plugin", "0.28.0") plugin("maven-publish", "com.vanniktech.maven.publish").versionRef(mavenPublishPlugin) plugin("maven-publish-base", "com.vanniktech.maven.publish.base").versionRef(mavenPublishPlugin)