migrate docker-compose convention plugin out of buildSrc
This commit is contained in:
parent
105555bf6c
commit
f804c39a3b
32 changed files with 564 additions and 239 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import kafkatorio.distributions.asProvider
|
||||
import kafkatorio.distributions.typescriptAttributes
|
||||
import kafkatorio.tasks.GenerateTypeScriptTask
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
|
||||
|
|
@ -8,6 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||
|
||||
plugins {
|
||||
id("kafkatorio.conventions.lang.kotlin-multiplatform")
|
||||
id("dev.adamko.factorio-mod") // only needed for 'attributes' - need to split up the mod?
|
||||
kotlin("plugin.serialization")
|
||||
distribution
|
||||
}
|
||||
|
|
@ -28,8 +27,10 @@ kotlin {
|
|||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
testRuns.configureEach {
|
||||
executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import dev.adamko.kafkatorio.factoriomod.portal.FactorioModPublishTask
|
||||
import kafkatorio.distributions.asConsumer
|
||||
import kafkatorio.distributions.asProvider
|
||||
import kafkatorio.distributions.factorioModAttributes
|
||||
import kafkatorio.distributions.typescriptAttributes
|
||||
import dev.adamko.gradle.factorio.mod_portal.FactorioModPublishTask
|
||||
import dev.adamko.gradle.factorio.typescriptAttributes
|
||||
import dev.adamko.gradle.factorio.factorioModAttributes
|
||||
import kafkatorio.tasks.TypescriptToLuaTask
|
||||
import kotlinx.serialization.json.put
|
||||
import kotlinx.serialization.json.putJsonObject
|
||||
|
|
@ -13,6 +11,7 @@ import org.gradle.plugins.ide.idea.model.Path as IdeaImlPath
|
|||
|
||||
plugins {
|
||||
id("kafkatorio.conventions.lang.node")
|
||||
id("dev.adamko.factorio-mod")
|
||||
distribution
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||
|
||||
plugins {
|
||||
id("kafkatorio.conventions.lang.kotlin-jvm")
|
||||
id("dev.adamko.geedeecee")
|
||||
kotlin("plugin.serialization")
|
||||
application
|
||||
}
|
||||
|
||||
|
||||
description = "Consumes Syslog Kafkatorio packets and sends them to Kafka"
|
||||
description = "Provides a Syslog server that receives Kafkatorio packets and forwards them to Kafka"
|
||||
|
||||
val projectId: String by project.extra
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|||
|
||||
plugins {
|
||||
id("kafkatorio.conventions.lang.kotlin-jvm")
|
||||
id("dev.adamko.geedeecee")
|
||||
kotlin("plugin.serialization")
|
||||
application
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import dev.adamko.kafkatorio.factoriomod.FactorioMod
|
||||
import kafkatorio.distributions.asConsumer
|
||||
import kafkatorio.distributions.factorioModAttributes
|
||||
import dev.adamko.gradle.factorio.FactorioModPlugin
|
||||
import dev.adamko.gradle.factorio.factorioModAttributes
|
||||
import kafkatorio.extensions.not
|
||||
import kafkatorio.tasks.ProcessRunningSpec
|
||||
import org.gradle.kotlin.dsl.support.serviceOf
|
||||
|
|
@ -8,6 +7,7 @@ import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
|||
|
||||
plugins {
|
||||
id("kafkatorio.conventions.infra.process-runner")
|
||||
id("dev.adamko.factorio-mod")
|
||||
}
|
||||
|
||||
description = "Start the Factorio game client"
|
||||
|
|
@ -26,10 +26,10 @@ val steamExe: RegularFileProperty = objects.fileProperty().apply {
|
|||
}
|
||||
}
|
||||
|
||||
val factorioMod: Configuration by configurations.creating {
|
||||
asConsumer()
|
||||
factorioModAttributes(objects)
|
||||
}
|
||||
//val factorioMod: Configuration by configurations.creating {
|
||||
// asConsumer()
|
||||
// factorioModAttributes(objects)
|
||||
//}
|
||||
|
||||
dependencies {
|
||||
factorioMod(projects.modules.eventsMod)
|
||||
|
|
@ -39,7 +39,7 @@ dependencies {
|
|||
//<editor-fold desc="Mod deployment tasks">
|
||||
val deployModToLocalClient by tasks.registering(Copy::class) {
|
||||
description = "Copy the mod to the Factorio client"
|
||||
group = FactorioMod.TASK_GROUP
|
||||
group = FactorioModPlugin.TASK_GROUP
|
||||
|
||||
val clientModsDirectory123 = clientModsDirectory
|
||||
|
||||
|
|
@ -61,7 +61,7 @@ fun ExecOperations.isFactorioRunning(): Spec<Task> = ProcessRunningSpec(this, "f
|
|||
|
||||
val clientLaunch by tasks.registering(Exec::class) {
|
||||
description = "Run local Factorio Steam game client"
|
||||
group = FactorioMod.TASK_GROUP
|
||||
group = FactorioModPlugin.TASK_GROUP
|
||||
|
||||
val steamExe123 = steamExe
|
||||
val clientModsDirectory444 = clientModsDirectory
|
||||
|
|
@ -83,7 +83,7 @@ val clientLaunch by tasks.registering(Exec::class) {
|
|||
|
||||
val clientKill by tasks.registering(Exec::class) {
|
||||
description = "Stop the local Factorio Steam game client"
|
||||
group = FactorioMod.TASK_GROUP
|
||||
group = FactorioModPlugin.TASK_GROUP
|
||||
|
||||
onlyIf(serviceOf<ExecOperations>().isFactorioRunning())
|
||||
|
||||
|
|
@ -93,8 +93,8 @@ val clientKill by tasks.registering(Exec::class) {
|
|||
//</editor-fold>
|
||||
|
||||
|
||||
tasks.register(FactorioMod.PUBLISH_MOD_LOCAL_TASK_NAME) {
|
||||
group = FactorioMod.TASK_GROUP
|
||||
tasks.register(FactorioModPlugin.PUBLISH_MOD_LOCAL_TASK_NAME) {
|
||||
group = FactorioModPlugin.TASK_GROUP
|
||||
dependsOn(deployModToLocalClient)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,22 @@
|
|||
import dev.adamko.kafkatorio.factoriomod.FactorioMod
|
||||
import kafkatorio.distributions.asConsumer
|
||||
import kafkatorio.distributions.factorioModAttributes
|
||||
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
||||
import dev.adamko.gradle.factorio.FactorioModPlugin
|
||||
|
||||
plugins {
|
||||
id("kafkatorio.conventions.infra.docker-compose")
|
||||
id("dev.adamko.geedeecee")
|
||||
id("dev.adamko.factorio-mod")
|
||||
idea
|
||||
}
|
||||
|
||||
|
||||
val dockerSrcDir: Directory by extra
|
||||
val factorioServerDataDir: Directory = dockerSrcDir.dir("factorio-server")
|
||||
//val dockerSrcDir: Directory by extra
|
||||
//val factorioServerDataDir: Directory = dockerSrcDir.dir("factorio-server")
|
||||
val factorioServerDataDir: DirectoryProperty = objects.directoryProperty()
|
||||
.convention(geedeecee.srcDir.dir("factorio-server"))
|
||||
|
||||
|
||||
val factorioMod: Configuration by configurations.creating {
|
||||
asConsumer()
|
||||
factorioModAttributes(objects)
|
||||
}
|
||||
//val factorioMod: Configuration by configurations.creating {
|
||||
// asConsumer()
|
||||
// factorioModAttributes(objects)
|
||||
//}
|
||||
|
||||
|
||||
dependencies {
|
||||
|
|
@ -25,13 +26,14 @@ dependencies {
|
|||
|
||||
val deployModToLocalServer by tasks.registering(Copy::class) {
|
||||
description = "Copy the mod to the Factorio Docker server"
|
||||
group = FactorioMod.TASK_GROUP
|
||||
group = FactorioModPlugin.TASK_GROUP
|
||||
|
||||
dependsOn(factorioMod)
|
||||
|
||||
from(
|
||||
provider { factorioMod.incoming.artifacts.artifactFiles.files }
|
||||
)
|
||||
// from(
|
||||
// provider { factorioMod.incoming.artifacts.artifactFiles.files }
|
||||
// )
|
||||
from(configurations.factorioMod.map { it.incoming.artifacts.artifactFiles.files })
|
||||
into(factorioServerDataDir.dir("mods"))
|
||||
|
||||
doLast {
|
||||
|
|
@ -40,12 +42,12 @@ val deployModToLocalServer by tasks.registering(Copy::class) {
|
|||
}
|
||||
|
||||
|
||||
tasks.dockerDown {
|
||||
commandLine = parseSpaceSeparatedArgs(""" docker-compose stop """)
|
||||
}
|
||||
//tasks.dockerComposeDown {
|
||||
// commandLine = parseSpaceSeparatedArgs(""" docker-compose stop """)
|
||||
//}
|
||||
|
||||
|
||||
tasks.dockerUp {
|
||||
tasks.dockerComposeUp {
|
||||
dependsOn(
|
||||
deployModToLocalServer,
|
||||
":modules:infra-kafka-cluster:processRun",
|
||||
|
|
@ -56,7 +58,7 @@ tasks.dockerUp {
|
|||
val kafkatorioServerToken: String by project
|
||||
|
||||
|
||||
tasks.dockerEnvUpdate {
|
||||
tasks.dockerComposeEnvUpdate {
|
||||
properties(
|
||||
"FACTORIO_VERSION" to libs.versions.factorio.get(),
|
||||
"KAFKATORIO_TOKEN" to kafkatorioServerToken,
|
||||
|
|
@ -64,8 +66,8 @@ tasks.dockerEnvUpdate {
|
|||
}
|
||||
|
||||
|
||||
tasks.register(FactorioMod.PUBLISH_MOD_LOCAL_TASK_NAME) {
|
||||
group = FactorioMod.TASK_GROUP
|
||||
tasks.register(FactorioModPlugin.PUBLISH_MOD_LOCAL_TASK_NAME) {
|
||||
group = FactorioModPlugin.TASK_GROUP
|
||||
dependsOn(deployModToLocalServer)
|
||||
}
|
||||
|
||||
|
|
@ -79,5 +81,5 @@ idea {
|
|||
val runFactorioServer by tasks.registering {
|
||||
group = rootProject.name
|
||||
|
||||
dependsOn(tasks.processRun)
|
||||
dependsOn(tasks.dockerComposeUp)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
plugins {
|
||||
id("kafkatorio.conventions.infra.docker-compose")
|
||||
id("dev.adamko.geedeecee")
|
||||
}
|
||||
|
||||
description = "Kafka cluster"
|
||||
|
||||
tasks.dockerEnvUpdate {
|
||||
geedeecee {
|
||||
srcDir.set(layout.projectDirectory.dir("src"))
|
||||
}
|
||||
|
||||
tasks.dockerComposeEnvUpdate {
|
||||
properties(
|
||||
"GRAFANA_VERSION" to libs.versions.grafana,
|
||||
"PROMETHEUS_VERSION" to libs.versions.prometheus,
|
||||
|
|
@ -31,5 +35,5 @@ tasks.dockerEnvUpdate {
|
|||
val runKafkaCluster by tasks.registering {
|
||||
group = rootProject.name
|
||||
|
||||
dependsOn(tasks.processRun)
|
||||
dependsOn(tasks.dockerComposeUp)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
import kafkatorio.tasks.DockerComposeExec
|
||||
import dev.adamko.geedeecee.DockerComposeExec
|
||||
|
||||
plugins {
|
||||
id("kafkatorio.conventions.infra.docker-compose")
|
||||
id("dev.adamko.geedeecee")
|
||||
}
|
||||
|
||||
description = "Send events from a Factorio server to a Kafka topic "
|
||||
|
||||
|
||||
val dockerSrcDir: Directory by extra
|
||||
//val dockerSrcDir: Directory by extra
|
||||
|
||||
tasks.dockerUp {
|
||||
tasks.dockerComposeUp {
|
||||
dependsOn(":modules:infra-kafka-cluster:dockerUp")
|
||||
}
|
||||
|
||||
|
||||
val dockerBuildKafkaPipe by tasks.registering(DockerComposeExec::class) {
|
||||
dependsOn(tasks.dockerEnvUpdate)
|
||||
|
||||
dockerComposeDir.set(dockerSrcDir)
|
||||
dockerComposeDir.set(geedeecee.srcDir)
|
||||
command.set("docker-compose build kafka-pipe")
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import kafkatorio.tasks.DockerEnvUpdateTask
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
||||
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
|
||||
|
||||
|
|
@ -7,6 +6,7 @@ plugins {
|
|||
id("kafkatorio.conventions.lang.kotlin-js")
|
||||
id("io.kvision")
|
||||
kotlin("plugin.serialization")
|
||||
id("dev.adamko.geedeecee")
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -115,17 +115,18 @@ fun KotlinDependencyHandler.kvision(
|
|||
implementation("io.kvision:$module:${version.get()}", configure)
|
||||
}
|
||||
|
||||
geedeecee {
|
||||
srcDir.set(layout.projectDirectory.dir("docker"))
|
||||
}
|
||||
|
||||
val dockerEnvUpdate by tasks.registering(DockerEnvUpdateTask::class) {
|
||||
dotEnvFile.set(layout.projectDirectory.file("docker/.env"))
|
||||
|
||||
tasks.dockerComposeEnvUpdate {
|
||||
properties(
|
||||
"COMPOSE_PROJECT_NAME" to rootProject.name,
|
||||
"KAFKATORIO_VERSION" to project.version,
|
||||
"REGISTRY_HOST" to "dcr.adamko.dev:5000",
|
||||
)
|
||||
}
|
||||
tasks.assemble { dependsOn(dockerEnvUpdate) }
|
||||
|
||||
tasks.assemble { dependsOn(tasks.dockerComposeEnvUpdate) }
|
||||
|
||||
|
||||
val installThemeCss by tasks.registering(Copy::class) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue