Skip to content

Commit ea2daa8

Browse files
authored
Update to kotlin 2.2, jdk 21 and gradle 9 (#755)
* Update kotlin to 2.2.20 and gradle to 9.0 * Remove Coordinate3D to avoid KT-54513 https://youtrack.jetbrains.com/issue/KT-54513/ * Update to jdk-21 * Upgrade mockk test version * Bump minor versions * Start ktor upgrade * Fix ktor 3 migration * Convert gradle to use version catalog * Convert gradle allprojects to use buildSrc shared.gradle.kts * Add library versions file * Remove ExperimentalUnsignedTypes * Store cache version in versions too * Remove debug add junit platform launcher * Revert broken exposed version * Improved grand exchange clear()
1 parent 34e66e0 commit ea2daa8

File tree

151 files changed

+816
-693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+816
-693
lines changed

.github/workflows/create_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
run: mkdir -p data/cache/
2222
- uses: actions/setup-java@v3
2323
with:
24-
java-version: "19"
24+
java-version: "21"
2525
distribution: "temurin"
2626
architecture: x64
2727
cache: "gradle"

.github/workflows/test-with-coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- uses: actions/setup-java@v3
2323
with:
24-
java-version: "19"
24+
java-version: "21"
2525
distribution: "temurin"
2626
architecture: x64
2727
cache: "gradle"
@@ -48,7 +48,7 @@ jobs:
4848
run: chmod +x gradlew
4949

5050
- name: Get cache version
51-
run: echo "cache_version=$(./gradlew -q printCacheVersion)" >> $GITHUB_ENV
51+
run: echo "cache_version=$(./gradlew -q printCacheVersion | tail -n1 | xargs)" >> $GITHUB_ENV
5252

5353
- name: Restore game cache files from cache
5454
id: cache-files

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:19-jdk-alpine
1+
FROM eclipse-temurin:21-jdk-alpine
22
LABEL authors="Greg"
33
EXPOSE 43594/tcp
44

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Release](https://github.com/GregHib/void/actions/workflows/create_release.yml/badge.svg)](https://github.com/GregHib/void/actions/workflows/create_release.yml)
88
[![Docker](https://img.shields.io/badge/Docker-latest-blue.svg?logo=docker)](https://hub.docker.com/r/greghib/void)
99
[![Codecov](https://codecov.io/gh/GregHib/void/graph/badge.svg?token=7W6PTSHUTT)](https://codecov.io/gh/GregHib/void)
10-
[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.22-blue.svg?logo=kotlin)](http://kotlinlang.org)
10+
[![Kotlin](https://img.shields.io/badge/Kotlin-2.2.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
1111
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
1212

1313
<h1>RuneScape Revived</h1>
@@ -37,7 +37,7 @@
3737

3838
## Quick setup
3939

40-
1. Make sure you have [java 19 or above installed](https://adoptium.net/temurin/releases/?package=jre). (`java --version` on command line)
40+
1. Make sure you have [java 21 or above installed](https://adoptium.net/temurin/releases/?package=jre). (`java --version` on command line)
4141
2. Extract the [latest void.zip released bundle](https://github.com/GregHib/void/releases) into a directory.
4242
3. Extract the [latest pre-modified game files cache.zip](https://mega.nz/folder/ZMN2AQaZ#4rJgfzbVW0_mWsr1oPLh1A) into `/void/data/cache/`.
4343
4. Run either the `run-server.bat` on Windows, or `run-server.sh` on Linux.
@@ -69,7 +69,7 @@ Selecting `git` version control and entering the void project URL Found under th
6969
7070
Press "clone" and after the download is complete the project will be opened for you.
7171

72-
Under `Project Structure... | Project` settings set `SDK` to JDk 19+ (download as needed) and let it index.
72+
Under `Project Structure... | Project` settings set `SDK` to JDK 21+ (download as needed) and let it index.
7373

7474
Run the following command in the terminal to set up Gradle or close and re-open the project to trigger IntelliJ's `Open as Gradle Project` popup.
7575

buffer/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
dependencies {
1+
plugins {
2+
id("shared")
23
}

build.gradle.kts

Lines changed: 0 additions & 125 deletions
This file was deleted.

buildSrc/build.gradle.kts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
plugins {
2-
`kotlin-dsl`
1+
buildscript {
2+
dependencies {
3+
classpath(libs.kotlin)
4+
classpath(libs.shadow)
5+
}
36
}
47

5-
dependencies {
6-
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.9.20")
8+
plugins {
9+
`kotlin-dsl`
10+
alias(libs.plugins.jacoco.aggregation)
11+
alias(libs.plugins.spotless)
712
}
813

914
repositories {
1015
mavenCentral()
1116
}
17+
18+
dependencies {
19+
implementation(libs.kotlin.gradle)
20+
implementation(libs.shadow)
21+
implementation(libs.spotless)
22+
implementation(libs.kotlin.embeddable)
23+
}

buildSrc/settings.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
dependencyResolutionManagement {
2+
3+
@Suppress("UnstableApiUsage")
4+
repositories {
5+
mavenCentral()
6+
}
7+
8+
versionCatalogs {
9+
create("libs") {
10+
from(files("../gradle/libs.versions.toml"))
11+
}
12+
}
13+
}
14+
15+
rootProject.name = "buildSrc"
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
4+
plugins {
5+
kotlin("jvm")
6+
id("kotlin")
7+
id("idea")
8+
id("jacoco")
9+
id("com.diffplug.spotless")
10+
id("jacoco-report-aggregation")
11+
}
12+
13+
group = "world.gregs.void"
14+
version = System.getenv("GITHUB_REF_NAME") ?: "dev"
15+
16+
java.sourceCompatibility = JavaVersion.VERSION_21
17+
java.targetCompatibility = java.sourceCompatibility
18+
19+
kotlin {
20+
compilerOptions {
21+
jvmTarget.set(JvmTarget.JVM_21)
22+
// https://youtrack.jetbrains.com/issue/KT-4779/Generate-default-methods-for-implementations-in-interfaces
23+
freeCompilerArgs.addAll("-Xinline-classes", "-Xcontext-parameters", "-Xjvm-default=all-compatibility")
24+
}
25+
}
26+
27+
28+
dependencies {
29+
implementation(kotlin("stdlib-jdk8"))
30+
testImplementation("org.junit.platform:junit-platform-launcher:1.13.4")
31+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.13.4")
32+
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.13.4")
33+
}
34+
35+
if (name != "tools") {
36+
tasks.test {
37+
maxHeapSize = "5120m"
38+
useJUnitPlatform()
39+
failFast = true
40+
testLogging {
41+
events("passed", "skipped", "failed")
42+
exceptionFormat = TestExceptionFormat.FULL
43+
}
44+
finalizedBy(tasks.jacocoTestReport)
45+
}
46+
47+
tasks.jacocoTestReport {
48+
dependsOn(tasks.test)
49+
reports {
50+
xml.required = true
51+
csv.required = false
52+
}
53+
}
54+
}

cache/build.gradle.kts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
plugins {
2+
id("shared")
3+
}
4+
15
dependencies {
26
implementation(project(":buffer"))
37
implementation(project(":types"))
4-
implementation("com.displee:rs-cache-library:${findProperty("displeeCacheVersion")}")
5-
implementation("io.insert-koin:koin-core:${findProperty("koinVersion")}")
8+
implementation(libs.displee.cache)
9+
implementation(libs.koin)
10+
11+
implementation(libs.lzma)
12+
implementation(libs.kotlinx.coroutines)
13+
implementation(libs.fastutil)
614

7-
implementation("com.github.jponge:lzma-java:1.3")
8-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${findProperty("kotlinCoroutinesVersion")}")
9-
implementation("it.unimi.dsi:fastutil:${findProperty("fastUtilVersion")}")
10-
implementation("ch.qos.logback:logback-classic:${findProperty("logbackVersion")}")
11-
implementation("com.michael-bull.kotlin-inline-logger:kotlin-inline-logger-jvm:${findProperty("inlineLoggingVersion")}")
15+
implementation(libs.bundles.logging)
1216

13-
testImplementation("io.mockk:mockk:${findProperty("mockkVersion")}")
17+
testImplementation(libs.mockk)
1418
}

0 commit comments

Comments
 (0)