Update dependencies.

This commit is contained in:
Oliver Rümpelein 2023-04-08 21:57:38 +02:00
parent 59c8cae39b
commit ed5716875f
14 changed files with 27 additions and 20 deletions

View file

@ -1,6 +1,6 @@
ktor_version=2.0.1 ktor_version=2.2.4
kotlin_version=1.6.20 kotlin_version=1.8.20
logback_version=1.2.11 logback_version=1.4.6
kotlinx_html_version=0.7.5 kotlinx_html_version=0.8.0
shadowjar_version=7.1.2 shadowjar_version=8.1.1
kotlin.code.style=official kotlin.code.style=official

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -2,12 +2,15 @@ package de.pheerai.buzzer
import de.pheerai.buzzer.routing.configureRoutes import de.pheerai.buzzer.routing.configureRoutes
import de.pheerai.buzzer.setup.setupPlugins import de.pheerai.buzzer.setup.setupPlugins
import io.ktor.server.application.*
import io.ktor.server.engine.* import io.ktor.server.engine.*
import io.ktor.server.netty.* import io.ktor.server.netty.*
fun main() { fun main() {
embeddedServer(Netty, port = 8888, host = "0.0.0.0") { embeddedServer(Netty, port = 8888, host = "0.0.0.0", module = Application::myApplicationModule).start(wait = true)
setupPlugins() }
configureRoutes()
}.start(wait = true) fun Application.myApplicationModule() {
setupPlugins()
configureRoutes()
} }

View file

@ -10,5 +10,6 @@ open class TEMPLATE(
@HtmlTagMarker @HtmlTagMarker
inline fun FlowContent.template(classes: String? = null, crossinline block: TEMPLATE.() -> Unit = {}): Unit = TEMPLATE( inline fun FlowContent.template(classes: String? = null, crossinline block: TEMPLATE.() -> Unit = {}): Unit = TEMPLATE(
attributesMapOf("class", classes), consumer attributesMapOf("class", classes),
consumer,
).visit(block) ).visit(block)

View file

@ -10,12 +10,12 @@ fun HTML.createGameModeratorDocument() {
link( link(
href = "/assets/colors.css", href = "/assets/colors.css",
rel = "stylesheet", rel = "stylesheet",
type = "text/css" type = "text/css",
) )
link( link(
href = "/assets/gamemoderator.css", href = "/assets/gamemoderator.css",
rel = "stylesheet", rel = "stylesheet",
type = "text/css" type = "text/css",
) )
script { script {
src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"
@ -37,7 +37,7 @@ fun HTML.createGameModeratorDocument() {
receivedNames.push(ev.data) receivedNames.push(ev.data)
}); });
} }
""".trimIndent() """.trimIndent(),
) )
xEffect( xEffect(
//language=JavaScript //language=JavaScript
@ -47,7 +47,7 @@ fun HTML.createGameModeratorDocument() {
} else { } else {
Alpine.data.buzzerWebSocket.send("CLEAR:"); Alpine.data.buzzerWebSocket.send("CLEAR:");
} }
""".trimIndent() """.trimIndent(),
) )
div(classes = "parent") { div(classes = "parent") {
div(classes = "player") { div(classes = "player") {
@ -73,7 +73,7 @@ fun HTML.createGameModeratorDocument() {
clicked = true clicked = true
setTimeout(() => {clicked = false}, 50) setTimeout(() => {clicked = false}, 50)
} }
""".trimIndent() """.trimIndent(),
) )
xOn("mousedown", "clicked = true") xOn("mousedown", "clicked = true")
xOn("touchstart", "clicked = true") xOn("touchstart", "clicked = true")

View file

@ -10,12 +10,12 @@ fun HTML.createPlayerDocument() {
link( link(
href = "/assets/colors.css", href = "/assets/colors.css",
rel = "stylesheet", rel = "stylesheet",
type = "text/css" type = "text/css",
) )
link( link(
href = "/assets/player.css", href = "/assets/player.css",
rel = "stylesheet", rel = "stylesheet",
type = "text/css" type = "text/css",
) )
script { script {
src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js" src = "https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"
@ -48,7 +48,7 @@ fun HTML.createPlayerDocument() {
} }
}); });
} }
""".trimIndent() """.trimIndent(),
) )
div(classes = "input") { div(classes = "input") {
label { +"Player" } label { +"Player" }
@ -78,7 +78,7 @@ fun HTML.createPlayerDocument() {
clicked = false clicked = false
}, 50) }, 50)
} }
""".trimMargin() """.trimMargin(),
) )
xOn("mousedown", "clicked = true") xOn("mousedown", "clicked = true")
xOn("touchstart", "clicked = true") xOn("touchstart", "clicked = true")

View file

@ -4,5 +4,6 @@ import io.ktor.websocket.*
@JvmInline @JvmInline
value class PlayerSocket(val session: WebSocketSession) value class PlayerSocket(val session: WebSocketSession)
@JvmInline @JvmInline
value class GameModeratorSocket(val session: WebSocketSession) value class GameModeratorSocket(val session: WebSocketSession)

View file

@ -7,4 +7,6 @@ module buzzer {
requires io.ktor.server.core; requires io.ktor.server.core;
requires io.ktor.server.websockets; requires io.ktor.server.websockets;
requires io.ktor.server.html.builder; requires io.ktor.server.html.builder;
requires io.ktor.server.host.common;
requires io.ktor.server.netty;
} }