diff --git a/build.gradle.kts b/build.gradle.kts index adebffe..64e9433 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ -import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask import nl.littlerobots.vcu.plugin.resolver.VersionSelectors import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.dsl.JvmTarget @@ -11,7 +10,6 @@ plugins { kotlin("jvm") version(libs.versions.kotlin) alias(libs.plugins.detekt) alias(libs.plugins.dokka) - alias(libs.plugins.versions) alias(libs.plugins.version.catalog.update) alias(libs.plugins.nmcp.aggregation) alias(libs.plugins.nmcp) @@ -65,21 +63,6 @@ dependencies { nmcpAggregation(rootProject) } -fun isNonStable(version: String): Boolean { - val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) } - val regex = "^[0-9,.v-]+(-r)?$".toRegex() - val isStable = stableKeyword || regex.matches(version) - return isStable.not() -} - -tasks.withType { - rejectVersionIf { - isNonStable(candidate.version) - } - - gradleReleaseChannel = "current" -} - versionCatalogUpdate { versionSelector(VersionSelectors.STABLE) } @@ -90,18 +73,22 @@ versionCatalogUpdate { // Task Configuration // //////////////////////// -val javadoc: Javadoc by tasks +val sourcesJar = tasks.register("sourcesJar") { + group = "build" + description = "Assembles sources JAR" -val sourcesJar by tasks.registering(Jar::class) { from(sourceSets["main"].allSource) archiveClassifier.set("sources") } -val javadocJar by tasks.registering(Jar::class) { - from(javadoc.destinationDir) +val javadocJar = tasks.register("javadocJar") { + group = "build" + description = "Assembles javadoc JAR" + + from(tasks.javadoc.get().destinationDir) archiveClassifier.set("javadoc") - dependsOn(javadoc) + dependsOn(tasks.javadoc) } tasks.build { diff --git a/detekt.yml b/detekt.yml index 5c79e16..88c93eb 100644 --- a/detekt.yml +++ b/detekt.yml @@ -29,7 +29,7 @@ potential-bugs: Deprecation: active: true IgnoredReturnValue: - restrictToAnnotatedMethods: false + restrictToConfig: false active: true MissingPackageDeclaration: active: true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2d4db11..354ffd9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,18 +1,17 @@ [versions] -jda = "6.3.2" -kotlin = "2.3.10" +jda = "6.4.2" +kotlin = "2.4.0" [libraries] -coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2" +coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.11.0" jda = { module = "net.dv8tion:JDA", version.ref = "jda" } kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } -logback = "ch.qos.logback:logback-classic:1.5.32" +logback = "ch.qos.logback:logback-classic:1.5.37" webhooks = "club.minnced:discord-webhooks:0.8.4" [plugins] detekt = "io.gitlab.arturbosch.detekt:1.23.8" -dokka = "org.jetbrains.dokka:2.1.0" -version-catalog-update = "nl.littlerobots.version-catalog-update:1.1.0" -versions = "com.github.ben-manes.versions:0.53.0" +dokka = "org.jetbrains.dokka:2.2.0" nmcp = "com.gradleup.nmcp:1.6.1" nmcp-aggregation = "com.gradleup.nmcp.aggregation:1.6.1" +version-catalog-update = "nl.littlerobots.version-catalog-update:1.1.0" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 8bdaf60..b1b8ef5 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 bad7c24..a9db115 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,9 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index ef07e01..249efbb 100755 --- a/gradlew +++ b/gradlew @@ -20,7 +20,7 @@ ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -29,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/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/. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index db3a6ac..a51ec4f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -19,12 +19,12 @@ @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -51,7 +51,7 @@ 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 +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -65,30 +65,18 @@ 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 +"%COMSPEC%" /c exit 1 :execute @rem Setup the command line -set CLASSPATH= -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL%