Skip to content

Commit 2370a84

Browse files
committed
bump to java 17, kotlin 2.3.0
1 parent 524c5d8 commit 2370a84

12 files changed

Lines changed: 39 additions & 44 deletions

File tree

‎.github/workflows/build-and-test.yml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-java@v4
1212
with:
13-
distribution: zulu
14-
java-version: 11.0.18
13+
distribution: temurin
14+
java-version: 17.0.15
1515
cache: 'gradle'
1616
- name: Verify tests
1717
run: |
@@ -30,8 +30,8 @@ jobs:
3030
- uses: actions/checkout@v4
3131
- uses: actions/setup-java@v4
3232
with:
33-
distribution: zulu
34-
java-version: 11.0.18
33+
distribution: temurin
34+
java-version: 17.0.15
3535
cache: 'gradle'
3636
- name: Build & Unit Test
3737
run: |
@@ -75,8 +75,8 @@ jobs:
7575
- uses: actions/checkout@v4
7676
- uses: actions/setup-java@v4
7777
with:
78-
distribution: zulu
79-
java-version: 11.0.18
78+
distribution: temurin
79+
java-version: 17.0.15
8080
cache: 'gradle'
8181
- name: Integration & E2E
8282
env:
@@ -95,8 +95,8 @@ jobs:
9595
- uses: actions/checkout@v4
9696
- uses: actions/setup-java@v4
9797
with:
98-
distribution: zulu
99-
java-version: 11.0.18
98+
distribution: temurin
99+
java-version: 17.0.15
100100
- name: Build JAR
101101
run: ./gradlew jar --info
102102
- name: Export JAR

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
- uses: actions/checkout@v4
1717
- uses: actions/setup-java@v4
1818
with:
19-
distribution: zulu
20-
java-version: 11
19+
distribution: temurin
20+
java-version: 17.0.15
2121
- name: Build JAR
2222
env:
2323
AWS_SYNC: ${{ secrets.AWS_SYNC }}

‎build.gradle.kts‎

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import java.net.URI
22
import kotlinx.kover.api.KoverTaskExtension
33
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
44
import org.gradle.api.tasks.testing.logging.TestLogEvent
5+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
56
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
67

78
plugins {
8-
kotlin("jvm") version "1.9.22"
9+
kotlin("jvm") version "2.3.0"
910
id("java-library")
1011
id("com.github.ben-manes.versions") version "0.44.0"
11-
id("io.gitlab.arturbosch.detekt") version "1.23.0"
12+
id("io.gitlab.arturbosch.detekt") version "1.23.8"
1213
id("org.jetbrains.kotlinx.kover") version "0.6.1"
1314
id("com.ncorti.ktfmt.gradle") version "0.15.1"
1415
}
@@ -57,24 +58,14 @@ kotlin { sourceSets.all { languageSettings { languageVersion = "2.0" } } }
5758

5859
project.setProperty("mainClassName", "dartzee.main.DartsMainKt")
5960

60-
val compileKotlin: KotlinCompile by tasks
61-
val compileTestKotlin: KotlinCompile by tasks
61+
kotlin {
62+
compilerOptions {
63+
jvmTarget.set(JvmTarget.JVM_1_8)
6264

63-
compileKotlin.kotlinOptions {
64-
jvmTarget = "11"
65-
66-
java {
67-
sourceCompatibility = JavaVersion.VERSION_11
68-
targetCompatibility = JavaVersion.VERSION_1_8
69-
}
70-
}
71-
72-
compileTestKotlin.kotlinOptions {
73-
jvmTarget = "11"
74-
75-
java {
76-
sourceCompatibility = JavaVersion.VERSION_11
77-
targetCompatibility = JavaVersion.VERSION_11
65+
java {
66+
sourceCompatibility = JavaVersion.VERSION_17
67+
targetCompatibility = JavaVersion.VERSION_1_8
68+
}
7869
}
7970
}
8071

@@ -114,14 +105,13 @@ tasks.withType<Test> {
114105
minHeapSize = "1024m"
115106
maxHeapSize = "1024m"
116107

117-
jvmArgs =
118-
listOf(
119-
"-Dcom.sun.management.jmxremote",
120-
"-Dcom.sun.management.jmxremote.port=9010",
121-
"-Dcom.sun.management.jmxremote.authenticate=false",
122-
"-Dcom.sun.management.jmxremote.ssl=false",
123-
"-Djava.rmi.server.hostname=localhost"
124-
)
108+
jvmArgs("-Dcom.sun.management.jmxremote",
109+
"-Dcom.sun.management.jmxremote.port=9010",
110+
"-Dcom.sun.management.jmxremote.authenticate=false",
111+
"-Dcom.sun.management.jmxremote.ssl=false",
112+
"-Djava.rmi.server.hostname=localhost",
113+
"--add-opens", "java.desktop/sun.awt=ALL-UNNAMED",
114+
"--add-opens", "java.desktop/java.awt=ALL-UNNAMED")
125115

126116
extensions.configure<KoverTaskExtension> { isDisabled.set(name != "unitTest") }
127117

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

‎src/test/kotlin/dartzee/core/screen/TestTableModelDialog.kt‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package dartzee.core.screen
22

3+
import com.github.alyssaburlton.swingtest.clickOk
4+
import com.github.alyssaburlton.swingtest.shouldNotBeVisible
35
import dartzee.core.bean.ScrollTable
46
import dartzee.core.util.getAllChildComponentsForType
57
import dartzee.helper.AbstractTest
@@ -36,10 +38,10 @@ class TestTableModelDialog : AbstractTest() {
3638
@Test
3739
fun `Should dispose when Ok is pressed`() {
3840
val tmd = TableModelDialog("Test", ScrollTable())
41+
tmd.isVisible = true
3942

40-
val spy = spyk(tmd)
41-
spy.okPressed()
43+
tmd.clickOk()
4244

43-
verify { spy.dispose() }
45+
tmd.shouldNotBeVisible()
4446
}
4547
}

‎src/test/kotlin/dartzee/logging/TestLoggingUtils.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TestLoggingUtils : AbstractTest() {
2121

2222
stackTrace shouldContain "java.lang.Throwable: Boom."
2323
stackTrace shouldContain
24-
"\tat dartzee.logging.TestLoggingUtils\$Should extract stack trace\$runnable\$1.invoke"
24+
"\tat dartzee.logging.TestLoggingUtils.Should_extract_stack_trace"
2525
}
2626

2727
@Test

‎src/test/kotlin/dartzee/screen/game/TestDartsMatchScreen.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ class TestDartsMatchScreen : AbstractTest() {
181181

182182
val firstPanel = scrn.addGameToMatchOnEdt(firstGame)
183183
every { firstPanel.getPlayerStates() } returns gameOneStates
184-
scrn.size = Dimension(1000, 1000)
184+
scrn.size = Dimension(1000, 950)
185185

186186
scrn.startNextGameIfNecessaryOnEdt()
187-
scrn.size.shouldBe(Dimension(1000, 1000))
187+
scrn.size.shouldBe(Dimension(1000, 950))
188188
}
189189

190190
private fun setUpMatchScreen(

‎src/test/kotlin/dartzee/screen/preference/TestPreferencesPanelDartboard.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dartzee.screen.preference
22

3+
import com.github.alyssaburlton.swingtest.flushEdt
34
import com.github.alyssaburlton.swingtest.getChild
45
import com.github.alyssaburlton.swingtest.toBufferedImage
56
import com.github.alyssaburlton.swingtest.waitForAssertion
@@ -45,6 +46,8 @@ class TestPreferencesPanelDartboard : AbstractPreferencePanelTest<PreferencesPan
4546
dartboard.width shouldBeGreaterThan 0
4647
}
4748

49+
flushEdt()
50+
4851
val center = dartboard.computeCenter()
4952
val oldRgb = dartboard.toBufferedImage().getRGB(center.x, center.y)
5053
oldRgb shouldBe color.rgb
12 Bytes
Loading
10 Bytes
Loading

0 commit comments

Comments
 (0)