Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.

Commit 28ac220

Browse files
authored
Merge 199dc60 into 25efb88
2 parents 25efb88 + 199dc60 commit 28ac220

180 files changed

Lines changed: 5543 additions & 8 deletions

File tree

Some content is hidden

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

build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
1111

1212
plugins {
1313
application
14-
kotlin("multiplatform") version "1.9.+" // when replacing, search the whole file for "9"
15-
kotlin("plugin.serialization") version "1.9.+"
14+
kotlin("multiplatform") version "1.9.10"
15+
kotlin("plugin.serialization") version "1.9.10"
1616
id("com.apollographql.apollo3") version "4.+"
1717
id("com.github.johnrengelman.shadow") version "8.+"
1818
id("org.jlleitschuh.gradle.ktlint") version "11.+"
19-
id("com.github.breadmoirai.github-release") version "2.+"
19+
id("com.github.breadmoirai.github-release") version "2.4.+"
2020
id("app.cash.sqldelight") version "2.+"
2121
}
2222

@@ -140,6 +140,7 @@ kotlin {
140140
archiveBaseName.set(output.artifact)
141141
archiveClassifier.set("")
142142
archiveVersion.set("")
143+
isZip64 = true
143144

144145
val jvmMainCompilation = jvmTarget.compilations.getByName<KotlinJvmCompilation>("main")
145146
from(jvmMainCompilation.output)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ org.gradle.jvmargs=-Xmx4096m
99
# Project properties
1010
config.group = xyz.marinkovic.milos
1111
config.artifact = codestats
12-
config.version = 0.7.0
12+
config.version = 0.8.0
1313
config.gitHubRepoOwner = milosmns
1414
config.gitHubRepoName = code-stats

src/commonMain/kotlin/commands/cli/ServeCommand.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import io.ktor.server.plugins.contentnegotiation.ContentNegotiation
1717
import io.ktor.server.plugins.cors.routing.CORS
1818
import io.ktor.server.plugins.forwardedheaders.ForwardedHeaders
1919
import io.ktor.server.response.respond
20+
import io.ktor.server.routing.Route
2021
import io.ktor.server.routing.get
2122
import io.ktor.server.routing.routing
2223
import kotlinx.coroutines.Runnable
@@ -31,7 +32,7 @@ class ServeCommand(
3132
) : Runnable {
3233

3334
@Serializable
34-
private data class MessageResponse(val message: String)
35+
data class MessageResponse(val message: String)
3536

3637
private lateinit var server: BaseApplicationEngine
3738
private lateinit var storedRepos: List<Repository>
@@ -75,18 +76,18 @@ class ServeCommand(
7576
server = embeddedServer(
7677
factory = CIO,
7778
port = serverConfig.portApi,
78-
) { customizeConfiguration() }
79+
) { setUp() }
7980

8081
server.start(wait = true)
8182
}
8283

83-
private fun Application.customizeConfiguration() {
84+
private fun Application.setUp() {
8485
install(ForwardedHeaders)
8586
install(CORS) { allowHost("localhost") }
8687
install(ContentNegotiation) { json() }
8788

8889
routing {
89-
get("/") { call.respond(MessageResponse("Yep, it runs…")) }
90+
setUpRoot()
9091
get("/repos") { call.respond(storedRepos) }
9192
get("/metrics") { call.respond(metricsByName) }
9293
get("/time-series") { call.respond(metricsByNameTimeSeries) }
@@ -98,3 +99,5 @@ class ServeCommand(
9899
}
99100

100101
}
102+
103+
expect fun Route.setUpRoot(): Route
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

0 commit comments

Comments
 (0)