2022-02-27 01:01:24 +01:00
|
|
|
import dev.adamko.kafkatorio.task.KafkaConsumerGroupsTask
|
2021-12-28 16:26:23 +01:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
|
|
2021-10-22 18:19:53 +02:00
|
|
|
plugins {
|
2022-01-16 23:16:09 +01:00
|
|
|
dev.adamko.kafkatorio.lang.`kotlin-jvm`
|
2021-10-25 23:35:47 +02:00
|
|
|
kotlin("plugin.serialization")
|
2021-10-24 14:55:04 +02:00
|
|
|
application
|
2021-10-22 18:19:53 +02:00
|
|
|
}
|
|
|
|
|
|
2021-12-01 13:35:32 +01:00
|
|
|
description = """
|
2021-10-22 18:19:53 +02:00
|
|
|
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
|
|
|
|
|
|
2022-05-18 19:32:52 +02:00
|
|
|
val kafkaStateDir: Directory = layout.projectDirectory.dir("kafka-state")
|
2022-02-09 13:16:57 +01:00
|
|
|
|
2021-10-24 14:55:04 +02:00
|
|
|
dependencies {
|
2022-05-01 09:41:49 +02:00
|
|
|
implementation(platform(projects.modules.versionsPlatform))
|
2021-10-24 14:55:04 +02:00
|
|
|
|
2022-02-09 11:53:58 +01:00
|
|
|
implementation(libs.kafka.streams)
|
2022-03-12 16:42:24 +01:00
|
|
|
testImplementation(libs.kafka.streamsTestUtils)
|
2021-10-24 14:55:04 +02:00
|
|
|
|
2021-12-01 16:57:46 +01:00
|
|
|
implementation(projects.modules.eventsSchema)
|
2021-12-01 13:35:32 +01:00
|
|
|
|
|
|
|
|
// implementation("com.ionspin.kotlin:bignum:0.3.3")
|
|
|
|
|
|
|
|
|
|
implementation(libs.kotlinx.serialization.core)
|
|
|
|
|
implementation(libs.kotlinx.serialization.json)
|
2022-03-12 22:00:58 +01:00
|
|
|
// implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf")
|
2021-10-25 23:35:47 +02:00
|
|
|
|
2022-05-01 09:41:49 +02:00
|
|
|
implementation(libs.kotlinx.coroutines.core)
|
2021-12-27 12:44:37 +01:00
|
|
|
|
2021-12-28 16:26:23 +01:00
|
|
|
implementation(libs.bundles.http4k)
|
2021-12-01 13:35:32 +01:00
|
|
|
implementation(libs.http4k.format.kotlinx)
|
2021-10-24 14:55:04 +02:00
|
|
|
|
|
|
|
|
implementation(libs.bundles.logging)
|
2022-01-13 00:00:59 +01:00
|
|
|
|
2022-03-12 22:00:58 +01:00
|
|
|
implementation(libs.scrimage.core)
|
2022-01-16 23:16:09 +01:00
|
|
|
|
2022-04-19 23:25:10 +02:00
|
|
|
implementation(libs.okio.core)
|
|
|
|
|
|
2022-03-12 22:00:58 +01:00
|
|
|
implementation(libs.kafka.kotkaStreams) {
|
2022-01-16 23:16:09 +01:00
|
|
|
isChanging = true
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-24 14:55:04 +02:00
|
|
|
}
|
|
|
|
|
|
2022-02-05 12:20:25 +01:00
|
|
|
//configurations.all {
|
|
|
|
|
// resolutionStrategy.cacheDynamicVersionsFor(1, TimeUnit.MINUTES)
|
|
|
|
|
//}
|
|
|
|
|
|
2021-10-24 14:55:04 +02:00
|
|
|
application {
|
2022-01-09 11:05:30 +01:00
|
|
|
mainClass.set("dev.adamko.kafkatorio.processor.EventProcessorKt")
|
2022-04-24 11:33:18 +02:00
|
|
|
|
|
|
|
|
// applicationDefaultJvmArgs += listOf(
|
|
|
|
|
// "-Dcom.sun.management.jmxremote.port=9186",
|
|
|
|
|
// "-Dcom.sun.management.jmxremote.rmi.port=9186",
|
|
|
|
|
// "-Dcom.sun.management.jmxremote.ssl=false",
|
|
|
|
|
// "-Dcom.sun.management.jmxremote.local.only=false",
|
|
|
|
|
// "-Dcom.sun.management.jmxremote.authenticate=false",
|
|
|
|
|
// )
|
2021-10-24 14:55:04 +02:00
|
|
|
}
|
2021-12-28 16:26:23 +01:00
|
|
|
|
2022-05-18 19:32:52 +02:00
|
|
|
tasks.withType<KotlinCompile>().configureEach {
|
2021-12-28 16:26:23 +01:00
|
|
|
kotlinOptions.freeCompilerArgs += listOf(
|
|
|
|
|
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
|
2022-02-05 12:20:25 +01:00
|
|
|
"-opt-in=kotlinx.coroutines.FlowPreview",
|
2022-02-26 17:34:31 +01:00
|
|
|
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
|
2021-12-28 16:26:23 +01:00
|
|
|
)
|
|
|
|
|
}
|
2022-02-08 11:51:16 +01:00
|
|
|
|
|
|
|
|
|
2022-02-27 01:01:24 +01:00
|
|
|
val kafkaStateDirDelete by tasks.registering(Delete::class) {
|
|
|
|
|
group = project.name
|
|
|
|
|
mustRunAfter(kafkaConsumersDelete)
|
2022-03-12 01:37:35 +01:00
|
|
|
delete(kafkaStateDir)
|
2022-02-27 01:01:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val kafkaConsumersDelete by tasks.registering(KafkaConsumerGroupsTask.DeleteAll::class) {
|
2022-02-26 17:34:31 +01:00
|
|
|
group = project.name
|
2022-02-08 11:51:16 +01:00
|
|
|
}
|
|
|
|
|
|
2022-02-08 14:10:13 +01:00
|
|
|
//tasks.run.configure {
|
|
|
|
|
// dependsOn(kafkatorioEventsServerKafkaForceReset)
|
|
|
|
|
//}
|
2022-03-12 01:37:35 +01:00
|
|
|
|
|
|
|
|
idea {
|
|
|
|
|
module {
|
|
|
|
|
excludeDirs = excludeDirs + kafkaStateDir.asFile
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-24 19:00:37 +02:00
|
|
|
|
|
|
|
|
//tasks.withType<KotlinNpmInstallTask>().all {
|
|
|
|
|
// notCompatibleWithConfigurationCache("error: Projects must be configuring")
|
|
|
|
|
//}
|