- use kxs-ts-gen for TypeScript schemas
- update schema files, so they're tidier (no need for typescript-generator workarounds)
- version bumps (kotlin, gradle, tstl, factorio, kotest)
- improve kxs binary format (use okio)
- move schema files package ('events' wasn't needed)
- tidy up topic creation, naming. base it off classes, make util functions
88 lines
2.2 KiB
Kotlin
88 lines
2.2 KiB
Kotlin
import dev.adamko.kafkatorio.task.KafkaConsumerGroupsTask
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
plugins {
|
|
dev.adamko.kafkatorio.lang.`kotlin-jvm`
|
|
kotlin("plugin.serialization")
|
|
application
|
|
}
|
|
|
|
description = """
|
|
Receive raw Factorio Events from Kafka and process them into targeted topics or data formats.
|
|
|
|
Factorio events -> Mod -> Kafka -> ***Factorio Events Processor*** -> processed events
|
|
""".trimIndent()
|
|
|
|
val projectId: String by project.extra
|
|
|
|
val kafkaStateDir = layout.projectDirectory.dir("kafka-state")
|
|
|
|
dependencies {
|
|
|
|
implementation(libs.kafka.streams)
|
|
testImplementation(libs.kafka.streamsTestUtils)
|
|
|
|
implementation(projects.modules.eventsSchema)
|
|
|
|
// implementation("com.ionspin.kotlin:bignum:0.3.3")
|
|
|
|
implementation(platform(libs.kotlinx.serialization.bom))
|
|
implementation(libs.kotlinx.serialization.core)
|
|
implementation(libs.kotlinx.serialization.json)
|
|
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf")
|
|
|
|
implementation(libs.kotlinx.coroutines)
|
|
|
|
implementation(platform(libs.http4k.bom))
|
|
implementation(libs.bundles.http4k)
|
|
implementation(libs.http4k.format.kotlinx)
|
|
|
|
implementation(libs.bundles.logging)
|
|
|
|
implementation(libs.scrimage.core)
|
|
|
|
implementation(platform(libs.okio.bom))
|
|
implementation(libs.okio.core)
|
|
|
|
implementation(libs.kafka.kotkaStreams) {
|
|
isChanging = true
|
|
}
|
|
|
|
}
|
|
|
|
//configurations.all {
|
|
// resolutionStrategy.cacheDynamicVersionsFor(1, TimeUnit.MINUTES)
|
|
//}
|
|
|
|
application {
|
|
mainClass.set("dev.adamko.kafkatorio.processor.EventProcessorKt")
|
|
}
|
|
|
|
tasks.withType<KotlinCompile> {
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
|
"-opt-in=kotlinx.coroutines.FlowPreview",
|
|
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
|
)
|
|
}
|
|
|
|
|
|
val kafkaStateDirDelete by tasks.registering(Delete::class) {
|
|
group = project.name
|
|
mustRunAfter(kafkaConsumersDelete)
|
|
delete(kafkaStateDir)
|
|
}
|
|
|
|
val kafkaConsumersDelete by tasks.registering(KafkaConsumerGroupsTask.DeleteAll::class) {
|
|
group = project.name
|
|
}
|
|
|
|
//tasks.run.configure {
|
|
// dependsOn(kafkatorioEventsServerKafkaForceReset)
|
|
//}
|
|
|
|
idea {
|
|
module {
|
|
excludeDirs = excludeDirs + kafkaStateDir.asFile
|
|
}
|
|
}
|