diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 9fe9537..1ffd5c4 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -25,21 +25,23 @@ jobs: packages: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - uses: actions/setup-java@v4 + - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: java-version: '21' distribution: 'temurin' -# - name: Validate Gradle wrapper -# uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 + - name: Validate Gradle wrapper + uses: gradle/actions/wrapper-validation@39fdf500b386709a9a4a769f717dad447ac345b9 # v6 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@39fdf500b386709a9a4a769f717dad447ac345b9 # v6 + with: + cache-provider: enhanced - name: Publish package - run: ./gradlew publish + run: ./gradlew publish --no-daemon env: GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 53cfad3..3f30786 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -25,37 +25,32 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 21 - uses: actions/setup-java@v4 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: java-version: '21' distribution: 'temurin' - name: Cache SonarCloud packages - uses: actions/cache@v4 + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache Gradle packages - uses: actions/cache@v4 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@39fdf500b386709a9a4a769f717dad447ac345b9 # v6 + with: + cache-provider: enhanced - name: Build with Gradle run: ./gradlew build - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 12995ee..239af21 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,6 @@ jobs: runs-on: ubuntu-24.04 steps: - name: "Generate release changelog" - uses: heinrichreimer/github-changelog-generator-action@v2.4 + uses: heinrichreimer/github-changelog-generator-action@e60b5a2bd9fcd88dadf6345ff8327863fb8b490f # v2.4 with: - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index c0330a7..fca0d1e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,37 +1,35 @@ -import java.lang.Runtime - plugins { - kotlin("jvm") version "2.1.20" - id("io.github.goooler.shadow") version "8.1.8" - jacoco - id("maven-publish") -} - -repositories { - mavenCentral() - maven { - url = uri("https://repo.papermc.io/repository/maven-public/") - } + alias(libs.plugins.kotlin) + alias(libs.plugins.gradleup.shadow) + alias(libs.plugins.jacoco) + alias(libs.plugins.maven.publish) } dependencies { - compileOnly("io.papermc.paper:paper-api:1.21.3-R0.1-SNAPSHOT") - compileOnly("org.jetbrains:annotations:26.0.1") + compileOnly(libs.paper.api) + compileOnly(libs.jetbrains.annotations) + + implementation(libs.kotlin.stdlib) + implementation(libs.classgraph) + implementation(libs.apache.commons.lang3) + implementation(libs.kotlinx.coroutines.core) + + testImplementation(libs.junit.jupiter.api) + testImplementation(libs.mockbukkit) + testImplementation(libs.hamcrest) - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0") - implementation("io.github.classgraph:classgraph:4.8.179") - implementation("org.apache.commons:commons-lang3:3.17.0") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1") + testRuntimeOnly(libs.junit.platform.launcher) - testImplementation("org.junit.jupiter:junit-jupiter-api:5.14.4") - testImplementation("org.mockbukkit.mockbukkit:mockbukkit-v1.21:4.25.1") - testImplementation("org.hamcrest:hamcrest-library:3.0") +} - testRuntimeOnly("org.junit.platform:junit-platform-launcher") +dependencyLocking { + lockAllConfigurations() + ignoredDependencies.add("io.papermc.paper:paper-api") } -val jarVersion = "1.5.0" +version = "1.5.0" +group = "de.thelooter" tasks { @@ -39,20 +37,36 @@ tasks { toolchain.languageVersion.set(JavaLanguageVersion.of(21)) } + kotlin { + jvmToolchain(21) + } + + jar { + archiveVersion.set(project.version.toString()) + } + shadowJar { relocate("io.github.classgraph", "de.thelooter.classgraph") relocate("org.apache.commons", "de.thelooter.commons") - archiveFileName.set("eventchecker-$jarVersion.jar") + archiveBaseName.set("eventchecker") + archiveClassifier.set("") + archiveVersion.set(project.version.toString()) + + mergeServiceFiles() } - jar { + assemble { dependsOn(shadowJar) } test { useJUnitPlatform() - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + maxParallelForks = providers.gradleProperty("test.maxParallelForks") + .map(String::toInt) + .getOrElse((Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)) + + finalizedBy(jacocoTestReport) } jacoco { @@ -65,24 +79,47 @@ tasks { html.required.set(true) html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml")) } - dependsOn(test) + } + + jacocoTestCoverageVerification { + violationRules { + rule { + limit { + counter = "INSTRUCTION" + value = "COVEREDRATIO" + minimum = "0.85".toBigDecimal() + } + limit { + counter = "BRANCH" + value = "COVEREDRATIO" + minimum = "0.60".toBigDecimal() + } + } + } + + dependsOn(jacocoTestReport) } check { dependsOn(jacocoTestReport) + dependsOn(jacocoTestCoverageVerification) } -} + withType().configureEach { + isPreserveFileTimestamps = false + isReproducibleFileOrder = true + } +} publishing { publications { create("maven") { - groupId = "de.thelooter" + groupId = project.group.toString() artifactId = "eventchecker" - version = jarVersion + version = project.version.toString() - from(components["java"]) + artifact(tasks.shadowJar) } } @@ -91,8 +128,14 @@ publishing { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/thelooter/EventChecker") credentials { - username = System.getenv("GITHUB_ACTOR") - password = System.getenv("GITHUB_TOKEN") + username = + providers.gradleProperty("gpr.user") + .orElse(providers.environmentVariable("GITHUB_ACTOR")) + .orNull + password = + providers.gradleProperty("gpr.key") + .orElse(providers.environmentVariable("GITHUB_TOKEN")) + .orNull } } } diff --git a/gradle.lockfile b/gradle.lockfile new file mode 100644 index 0000000..49aa2ca --- /dev/null +++ b/gradle.lockfile @@ -0,0 +1,115 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +com.google.auto.service:auto-service-annotations:1.1.1=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.code.gson:gson:2.10.1=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.18.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:guava-parent:32.1.2-jre=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:guava:32.1.2-jre=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata +com.googlecode.json-simple:json-simple:1.1.1=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.mojang:brigadier:1.2.9=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +commons-codec:commons-codec:1.16.0=testRuntimeClasspath +io.github.classgraph:classgraph:4.8.179=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +it.unimi.dsi:fastutil:8.5.6=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +javax.inject:javax.inject:1=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.15.10=testRuntimeClasspath +net.kyori:adventure-api:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-bom:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-key:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-nbt:4.17.0=testRuntimeClasspath +net.kyori:adventure-platform-api:4.3.4=testRuntimeClasspath +net.kyori:adventure-platform-bungeecord:4.3.4=testRuntimeClasspath +net.kyori:adventure-platform-facet:4.3.4=testRuntimeClasspath +net.kyori:adventure-text-logger-slf4j:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-text-minimessage:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-text-serializer-bungeecord:4.3.4=testRuntimeClasspath +net.kyori:adventure-text-serializer-gson:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-text-serializer-json:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-text-serializer-legacy:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:adventure-text-serializer-plain:4.17.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:examination-api:1.3.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:examination-string:1.3.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.kyori:option:1.0.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.md-5:bungeecord-chat:1.20-R0.2-deprecated+build.18=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.commons:commons-lang3:3.12.0=compileOnlyDependenciesMetadata +org.apache.commons:commons-lang3:3.17.0=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.httpcomponents:httpclient:4.5.14=testRuntimeClasspath +org.apache.httpcomponents:httpcore:4.4.16=testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.17.1=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven.resolver:maven-resolver-api:1.9.18=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18=testRuntimeClasspath +org.apache.maven.resolver:maven-resolver-impl:1.9.18=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven.resolver:maven-resolver-named-locks:1.9.18=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven.resolver:maven-resolver-spi:1.9.18=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven.resolver:maven-resolver-transport-http:1.9.18=testRuntimeClasspath +org.apache.maven.resolver:maven-resolver-util:1.9.18=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven:maven-artifact:3.9.6=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven:maven-builder-support:3.9.6=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven:maven-model-builder:3.9.6=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven:maven-model:3.9.6=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven:maven-repository-metadata:3.9.6=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apache.maven:maven-resolver-provider:3.9.6=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testImplementationDependenciesMetadata +org.checkerframework:checker-qual:3.33.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.codehaus.plexus:plexus-interpolation:1.26=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.codehaus.plexus:plexus-utils:3.5.1=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.eclipse.sisu:org.eclipse.sisu.inject:0.9.0.M2=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.hamcrest:hamcrest-core:3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.hamcrest:hamcrest-library:3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.12=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.12=jacocoAnt +org.jacoco:org.jacoco.core:0.8.12=jacocoAnt +org.jacoco:org.jacoco.report:0.8.12=jacocoAnt +org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-build-common:2.1.0=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-build-tools-api:2.1.0=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.0=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-compiler-runner:2.1.0=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-client:2.1.0=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.1.0=kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-script-runtime:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-scripting-common:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-jvm:2.1.0=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-stdlib-common:2.1.0=implementationDependenciesMetadata,testImplementationDependenciesMetadata +org.jetbrains.kotlin:kotlin-stdlib:2.1.0=compileClasspath,implementationDependenciesMetadata,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jetbrains.kotlinx:atomicfu:0.23.1=implementationDependenciesMetadata,testImplementationDependenciesMetadata +org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jetbrains:annotations:13.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains:annotations:23.0.0=runtimeClasspath +org.jetbrains:annotations:24.1.0=testCompileClasspath,testImplementationDependenciesMetadata +org.jetbrains:annotations:26.0.1=compileClasspath,compileOnlyDependenciesMetadata,testRuntimeClasspath +org.joml:joml:1.10.5=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.4=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.4=testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.4=testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.4=testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.4=testRuntimeClasspath +org.junit:junit-bom:5.14.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.mockbukkit.mockbukkit:mockbukkit-v1.21:4.25.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.ow2.asm:asm-commons:9.7=jacocoAnt +org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.7=jacocoAnt +org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath +org.ow2.asm:asm:9.7=jacocoAnt +org.ow2.asm:asm:9.7.1=testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.36=testRuntimeClasspath +org.slf4j:slf4j-api:2.0.9=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.yaml:snakeyaml:2.2=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +empty=annotationProcessor,apiDependenciesMetadata,intransitiveDependenciesMetadata,kotlinCompilerPluginClasspath,kotlinNativeCompilerPluginClasspath,kotlinScriptDefExtensions,shadow,testAnnotationProcessor,testApiDependenciesMetadata,testCompileOnlyDependenciesMetadata,testIntransitiveDependenciesMetadata,testKotlinScriptDefExtensions diff --git a/gradle.properties b/gradle.properties index af82e00..fe7da05 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,5 @@ -org.gradle.parallel=true \ No newline at end of file +org.gradle.parallel=true +org.gradle.caching=true +org.gradle.configuration-cache=true +org.gradle.configuration-cache.problems=warn +dependencyVerification.enabled=false \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..677fa45 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,30 @@ +[versions] +classgraph = "4.8.179" +commons-lang3 = "3.17.0" +hamcrest = "3.0" +jetbrains-annotations = "26.0.1" +junit = "5.14.4" +kotlin = "2.1.0" +kotlinx-coroutines = "1.10.1" +mockbukkit = "4.25.1" +paper = "1.21.3-R0.1-SNAPSHOT" + +shadow = "9.2.2" + +[libraries] +paper-api = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper" } +jetbrains-annotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrains-annotations" } +kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" } +classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" } +apache-commons-lang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "commons-lang3" } +kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } +junit-jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" } +junit-platform-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" } +hamcrest = { group = "org.hamcrest", name = "hamcrest-library", version.ref = "hamcrest" } +mockbukkit = { group = "org.mockbukkit.mockbukkit", name = "mockbukkit-v1.21", version.ref = "mockbukkit" } + +[plugins] +gradleup-shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } +maven-publish = { id = "maven-publish" } +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +jacoco = { id = "org.gradle.jacoco" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index a4b76b9..b1b8ef5 100755 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 cea7a79..4b271a6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,10 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip +distributionSha256Sum=553c78f50dafcd54d65b9a444649057857469edf836431389695608536d6b746 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index f3b75f3..b9bb139 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -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=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # 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" ) @@ -205,15 +203,14 @@ fi DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Collect all arguments for the java command: -# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# * DEFAULT_JVM_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" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" # Stop when "xargs" is not available. diff --git a/gradlew.bat b/gradlew.bat index 9d21a21..24c62d5 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -23,8 +23,8 @@ @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=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +@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% diff --git a/settings-gradle.lockfile b/settings-gradle.lockfile new file mode 100644 index 0000000..709a43f --- /dev/null +++ b/settings-gradle.lockfile @@ -0,0 +1,4 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +empty=incomingCatalogForLibs0 diff --git a/settings.gradle.kts b/settings.gradle.kts index 82f0543..d547a93 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,10 @@ +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } +} + plugins { id("com.gradle.develocity") version "4.0.1" } @@ -8,6 +15,15 @@ develocity { server = "https://scans.gradle.com" buildScan { termsOfUseUrl = "https://gradle.com/terms-of-service" - termsOfUseAgree = if (System.getenv("GITHUB_WORKFLOW").isNullOrEmpty()) "yes" else "no" + termsOfUseAgree = "yes" + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenCentral() + maven("https://repo.papermc.io/repository/maven-public/") } -} \ No newline at end of file +} +