Skip to content

Commit d6f20f6

Browse files
authored
Merge pull request #8 from JPL-Devin/devin/1776587436-upgrade-deps-kotlin-ktor-kotest
Upgrade Gradle 8.14, Kotlin 2.3.20, Ktor 3.4.2, Kotest 6.1.11, kotlinx-serialization 1.9.0
2 parents c755238 + d96c328 commit d6f20f6

56 files changed

Lines changed: 123 additions & 106 deletions

Some content is hidden

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

Dockerfile-Test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:17.0.2-jdk-slim as build
1+
FROM eclipse-temurin:21-jdk as build
22
WORKDIR application
33
ENV FLEXO_MMS_ROOT_CONTEXT http://layer1-service
44
ENV FLEXO_MMS_QUERY_URL http://quad-server:3030/ds/sparql

build.gradle.kts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import java.net.URI
33

44
plugins {
55
application
6-
kotlin("jvm") version "2.1.21"
7-
kotlin("plugin.serialization") version "2.1.21"
6+
kotlin("jvm") version "2.3.20"
7+
kotlin("plugin.serialization") version "2.3.20"
88
jacoco
99
id("org.sonarqube") version "6.2.0.5505"
1010
}
@@ -41,7 +41,7 @@ val testFuseki: Configuration by configurations.creating
4141
dependencies {
4242
implementation(kotlin("stdlib"))
4343

44-
val kotestVersion = "5.9.1"
44+
val kotestVersion = "6.1.11"
4545
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
4646
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
4747
testImplementation("io.kotest:kotest-assertions-json-jvm:$kotestVersion")
@@ -50,15 +50,15 @@ dependencies {
5050
val commonsCliVersion = "1.9.0"
5151
implementation("commons-cli:commons-cli:$commonsCliVersion")
5252

53-
val kotlinxJsonVersion = "1.8.1"
53+
val kotlinxJsonVersion = "1.9.0"
5454
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxJsonVersion")
5555

5656
val jenaVersion = "6.0.0"
5757
implementation("org.apache.jena:jena-arq:${jenaVersion}")
5858
testImplementation("org.apache.jena:jena-rdfconnection:${jenaVersion}");
5959
testFuseki("org.apache.jena:jena-fuseki-server:$jenaVersion")
6060

61-
val ktorVersion = "2.3.4"
61+
val ktorVersion = "3.4.2"
6262
implementation("io.ktor:ktor-client-core:${ktorVersion}")
6363
implementation("io.ktor:ktor-client-content-negotiation:${ktorVersion}")
6464
implementation("io.ktor:ktor-client-cio:${ktorVersion}")
@@ -71,11 +71,10 @@ dependencies {
7171
implementation("io.ktor:ktor-server-default-headers:$ktorVersion")
7272
implementation("io.ktor:ktor-server-forwarded-header:$ktorVersion")
7373
implementation("io.ktor:ktor-server-host-common:$ktorVersion")
74-
implementation("io.ktor:ktor-server-locations:$ktorVersion")
7574
implementation("io.ktor:ktor-server-netty:$ktorVersion")
7675
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
77-
testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
78-
testImplementation("io.kotest.extensions:kotest-assertions-ktor:2.0.0")
76+
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
77+
testImplementation("io.kotest:kotest-assertions-ktor:$kotestVersion")
7978

8079
val logbackVersion = "1.5.18"
8180
implementation("ch.qos.logback:logback-classic:$logbackVersion")
@@ -123,7 +122,7 @@ tasks.jacocoTestReport {
123122
}
124123
}
125124
tasks.register("generateBuildInfo") {
126-
val buildInfoFile = file("$buildDir/resources/main/build-info.properties")
125+
val buildInfoFile = layout.buildDirectory.file("resources/main/build-info.properties").get().asFile
127126
outputs.file(buildInfoFile)
128127
doLast {
129128
buildInfoFile.writeText(
@@ -138,6 +137,10 @@ tasks.named("processResources") {
138137
finalizedBy("generateBuildInfo")
139138
}
140139

140+
tasks.named("jar") {
141+
dependsOn("generateBuildInfo")
142+
}
143+
141144
val compileKotlin: KotlinCompile by tasks
142145
compileKotlin.compilerOptions {
143146
freeCompilerArgs.add("-Xdebug")

gradle/wrapper/gradle-wrapper.jar

2.04 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/kotlin/org/openmbee/flexo/mms/Application.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)
99

1010
@Suppress("unused")
1111
fun Application.module() {
12-
configureAuthentication(environment)
12+
configureAuthentication()
1313
configureHTTP()
1414
configureRouting()
1515
}

src/main/kotlin/org/openmbee/flexo/mms/Layer1Context.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ class Layer1Context<TRequestContext: GenericRequest, out TResponseContext: Gener
320320
/**
321321
* Execute a SPARQL Query string against Layer 0
322322
*/
323-
@OptIn(InternalAPI::class)
324323
suspend fun executeSparqlQuery(pattern: String, acceptType: ContentType, setup: (SparqlParameterizer.() -> Unit)?=null): String {
325324
// apply the optional parameterizer setup, default to using the built-in prefixes
326325
val params = SparqlParameterizer(pattern).apply {
@@ -347,7 +346,7 @@ class Layer1Context<TRequestContext: GenericRequest, out TResponseContext: Gener
347346
append(HttpHeaders.Accept, acceptType)
348347
}
349348
contentType(RdfContentTypes.SparqlQuery)
350-
body=sparql
349+
setBody(sparql)
351350
})
352351
}
353352

@@ -368,7 +367,6 @@ class Layer1Context<TRequestContext: GenericRequest, out TResponseContext: Gener
368367
/**
369368
* Execute a SPARQL Update string against Layer 0
370369
*/
371-
@OptIn(InternalAPI::class)
372370
suspend fun executeSparqlUpdate(pattern: String, setup: (SparqlParameterizer.() -> SparqlParameterizer)?=null): String {
373371
var sparql = SparqlParameterizer(pattern.trimIndent()).apply {
374372
if (setup != null) setup()
@@ -385,7 +383,7 @@ class Layer1Context<TRequestContext: GenericRequest, out TResponseContext: Gener
385383
append(HttpHeaders.Accept, ContentType.Any)
386384
}
387385
contentType(RdfContentTypes.SparqlUpdate)
388-
body=sparql
386+
setBody(sparql)
389387
})
390388
}
391389

src/main/kotlin/org/openmbee/flexo/mms/SparqlBuilder.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ fun serializePairs(node: Resource): String {
101101
abstract class SparqlBuilder<out Instance: SparqlBuilder<Instance>>(private val indentLevel: Int=1) {
102102
protected val sparqlString = StringBuilder()
103103

104+
@Suppress("UNCHECKED_CAST")
104105
fun raw(vararg sparql: String): Instance {
105106
sparqlString.append(sparql.joinToString("\n") { it.trimIndent()+"\n" })
106107

@@ -309,7 +310,7 @@ class InsertBuilder(
309310

310311
fun subtxn(subTxnId: String, extras: Map<String, String>?=null, setup: (TxnBuilder.() -> Unit)?=null): InsertBuilder {
311312
val properties = extras?.toMutableMap()?: mutableMapOf()
312-
if(null != layer1.userId) properties["mms:user"] = "mu:"
313+
properties["mms:user"] = "mu:"
313314
if(null != layer1.orgId) properties["mms:org"] = "mo:"
314315
if(null != layer1.repoId) properties["mms:repo"] = "mor:"
315316
if(null != layer1.branchId) properties["mms:branch"] = "morb:"
@@ -550,7 +551,7 @@ class UpdateBuilder(
550551
// prefixes(mms.prefixes)
551552

552553
literal(
553-
"_userId" to (layer1.userId?: ""),
554+
"_userId" to layer1.userId,
554555
"_orgId" to (layer1.orgId?: ""),
555556
"_repoId" to (layer1.repoId?: ""),
556557
"_branchId" to (layer1.branchId?: ""),

src/main/kotlin/org/openmbee/flexo/mms/routes/store/ArtifactStoreRead.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ suspend fun <TRequestContext: GenericRequest> Layer1Context<TRequestContext, Sto
8686
}
8787
}
8888
}
89-
val bytes = response.readBytes()
89+
val bytes = response.readRawBytes()
9090
DecodedArtifact(contentType, bodyBinary = bytes)
9191
}
9292
else -> {

0 commit comments

Comments
 (0)