tidy up Gradle config, standardise a group for Factorio Mod tasks
This commit is contained in:
parent
f2ae951b1d
commit
dacb6f62c4
13 changed files with 83 additions and 174 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
package dev.adamko.kafkatorio.factoriomod
|
package dev.adamko.kafkatorio.factoriomod.portal
|
||||||
|
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.engine.cio.CIO
|
import io.ktor.client.engine.cio.CIO
|
||||||
|
|
@ -98,7 +98,7 @@ class FactorioModPortalPublishClient(
|
||||||
require(response.status.isSuccess()) { "init upload request failed" }
|
require(response.status.isSuccess()) { "init upload request failed" }
|
||||||
|
|
||||||
return when (initUploadResponse) {
|
return when (initUploadResponse) {
|
||||||
is Failure -> error(initUploadResponse)
|
is Failure -> error(initUploadResponse)
|
||||||
is InitUploadResponse.Success -> initUploadResponse
|
is InitUploadResponse.Success -> initUploadResponse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package dev.adamko.kafkatorio.factoriomod
|
package dev.adamko.kafkatorio.factoriomod.portal
|
||||||
|
|
||||||
|
import dev.adamko.kafkatorio.factoriomod.FactorioMod
|
||||||
import io.ktor.http.URLBuilder
|
import io.ktor.http.URLBuilder
|
||||||
import io.ktor.http.takeFrom
|
import io.ktor.http.takeFrom
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
@ -59,7 +60,7 @@ abstract class FactorioModPublishTask @Inject constructor(
|
||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
group = "factorio"
|
group = FactorioMod.TASK_GROUP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package dev.adamko.kafkatorio.factoriomod
|
package dev.adamko.kafkatorio.factoriomod.portal
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package dev.adamko.kafkatorio.factoriomod
|
||||||
|
|
||||||
|
object FactorioMod {
|
||||||
|
|
||||||
|
const val TASK_GROUP = "factorioMod"
|
||||||
|
|
||||||
|
/** Lifecycle task for publishing the mod locally */
|
||||||
|
const val PUBLISH_MOD_LOCAL_TASK_NAME = "publishModLocal"
|
||||||
|
|
||||||
|
const val PUBLISH_MOD_TASK_NAME = "publishMod"
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -12,16 +12,8 @@ val projectJvmTarget = "11"
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
// implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
|
|
||||||
|
|
||||||
// testImplementation(platform("org.junit:junit-bom:${Versions.junit}"))
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||||
// testRuntimeOnly("org.junit.platform:junit-platform-launcher") {
|
|
||||||
// because("Only needed to run tests in a version of IntelliJ IDEA that bundles older versions")
|
|
||||||
// }
|
|
||||||
|
|
||||||
// testImplementation(platform("io.kotest:kotest-bom:${Versions.kotest}"))
|
|
||||||
testImplementation("io.kotest:kotest-runner-junit5")
|
testImplementation("io.kotest:kotest-runner-junit5")
|
||||||
testImplementation("io.kotest:kotest-assertions-core")
|
testImplementation("io.kotest:kotest-assertions-core")
|
||||||
testImplementation("io.kotest:kotest-property")
|
testImplementation("io.kotest:kotest-property")
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import org.gradle.api.tasks.OutputDirectory
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
|
||||||
|
|
||||||
abstract class GenerateTypescriptTask @Inject constructor(
|
abstract class GenerateTypeScriptTask @Inject constructor(
|
||||||
private val fileOps: FileSystemOperations,
|
private val fileOps: FileSystemOperations,
|
||||||
) : JavaExec() {
|
) : JavaExec() {
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import dev.adamko.kafkatorio.factoriomod.FactorioModPublishTask
|
import dev.adamko.kafkatorio.factoriomod.portal.FactorioModPublishTask
|
||||||
import dev.adamko.kafkatorio.gradle.asConsumer
|
import dev.adamko.kafkatorio.gradle.asConsumer
|
||||||
import dev.adamko.kafkatorio.gradle.asProvider
|
import dev.adamko.kafkatorio.gradle.asProvider
|
||||||
import dev.adamko.kafkatorio.gradle.dropDirectory
|
import dev.adamko.kafkatorio.gradle.dropDirectory
|
||||||
|
|
@ -43,7 +43,7 @@ val projectTokensX = projectTokens.apply {
|
||||||
put("mod.name", modName)
|
put("mod.name", modName)
|
||||||
put("mod.title", "Kafkatorio Events")
|
put("mod.title", "Kafkatorio Events")
|
||||||
put("mod.description", modDescription)
|
put("mod.description", modDescription)
|
||||||
put("factorio.version", modFactorioCompatibility.get())
|
put("factorio.version", modFactorioCompatibility)
|
||||||
}
|
}
|
||||||
|
|
||||||
val tsSrcDir: Directory = layout.projectDirectory.dir("src/main/typescript")
|
val tsSrcDir: Directory = layout.projectDirectory.dir("src/main/typescript")
|
||||||
|
|
@ -139,7 +139,8 @@ distributions {
|
||||||
from(licenseFile)
|
from(licenseFile)
|
||||||
from(typescriptToLua.map { it.outputDirectory })
|
from(typescriptToLua.map { it.outputDirectory })
|
||||||
filesNotMatching("**/*.png") {
|
filesNotMatching("**/*.png") {
|
||||||
filter<ReplaceTokens>("tokens" to projectTokens.get())
|
val tokens: MutableMap<String, String> = projectTokens.get()
|
||||||
|
filter<ReplaceTokens>("tokens" to tokens)
|
||||||
}
|
}
|
||||||
includeEmptyDirs = false
|
includeEmptyDirs = false
|
||||||
exclude {
|
exclude {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import dev.adamko.kafkatorio.gradle.asProvider
|
import dev.adamko.kafkatorio.gradle.asProvider
|
||||||
import dev.adamko.kafkatorio.gradle.typescriptAttributes
|
import dev.adamko.kafkatorio.gradle.typescriptAttributes
|
||||||
import dev.adamko.kafkatorio.task.GenerateTypescriptTask
|
import dev.adamko.kafkatorio.task.GenerateTypeScriptTask
|
||||||
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
|
@ -14,25 +14,8 @@ plugins {
|
||||||
kotlin {
|
kotlin {
|
||||||
|
|
||||||
js(IR) {
|
js(IR) {
|
||||||
// binaries.executable()
|
|
||||||
browser {}
|
browser {}
|
||||||
// browser{} causes this error:
|
// this is a library - don't set binaries.executable()
|
||||||
// Cannot load "webpack", it is not registered!
|
|
||||||
// Perhaps you are missing some plugin?
|
|
||||||
// Cannot load "sourcemap", it is not registered!
|
|
||||||
// Perhaps you are missing some plugin?
|
|
||||||
// Server start failed on port 9876: Error: No provider for "framework:mocha"! (Resolving: framework:mocha)
|
|
||||||
// browser {
|
|
||||||
// runTask {
|
|
||||||
// sourceMaps = true
|
|
||||||
// }
|
|
||||||
// testTask {
|
|
||||||
// useKarma {
|
|
||||||
// useChromeHeadless()
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// nodejs()
|
|
||||||
}
|
}
|
||||||
jvm {
|
jvm {
|
||||||
val main by compilations.getting {
|
val main by compilations.getting {
|
||||||
|
|
@ -75,9 +58,6 @@ kotlin {
|
||||||
|
|
||||||
implementation(project.dependencies.platform(libs.kotest.bom))
|
implementation(project.dependencies.platform(libs.kotest.bom))
|
||||||
implementation("io.kotest:kotest-framework-engine")
|
implementation("io.kotest:kotest-framework-engine")
|
||||||
// implementation("io.kotest:kotest-assertions-core")
|
|
||||||
// implementation("io.kotest:kotest-property")
|
|
||||||
// implementation("io.kotest:kotest-assertions-json")
|
|
||||||
implementation(libs.kotest.core)
|
implementation(libs.kotest.core)
|
||||||
implementation(libs.kotest.datatest)
|
implementation(libs.kotest.datatest)
|
||||||
implementation(libs.kotest.prop)
|
implementation(libs.kotest.prop)
|
||||||
|
|
@ -88,10 +68,7 @@ kotlin {
|
||||||
val jvmMain by getting {
|
val jvmMain by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.github.aSemy:ts-generator:v1.2.1")
|
implementation("com.github.aSemy:ts-generator:v1.2.1")
|
||||||
// implementation("com.github.ntrrgc:ts-generator:1.1.2")
|
|
||||||
implementation(kotlin("reflect"))
|
implementation(kotlin("reflect"))
|
||||||
|
|
||||||
// implementation("com.github.adamko-dev:kotlinx-serialization-typescript-generator:0.0.5")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +91,7 @@ val mainCompilation: Provider<FileCollection> =
|
||||||
kotlin.jvm().compilations.named("main").map { it.runtimeDependencyFiles }
|
kotlin.jvm().compilations.named("main").map { it.runtimeDependencyFiles }
|
||||||
|
|
||||||
|
|
||||||
val generateTypescript by tasks.registering(GenerateTypescriptTask::class) {
|
val generateTypeScript by tasks.registering(GenerateTypeScriptTask::class) {
|
||||||
dependsOn(jvmJar)
|
dependsOn(jvmJar)
|
||||||
classpath(
|
classpath(
|
||||||
jvmJar,
|
jvmJar,
|
||||||
|
|
@ -125,68 +102,26 @@ val generateTypescript by tasks.registering(GenerateTypescriptTask::class) {
|
||||||
args(temporaryDir.canonicalPath)
|
args(temporaryDir.canonicalPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
//val generateTypescript2 by tasks.registering(JavaExec::class) {
|
|
||||||
// group = "kt2ts"
|
|
||||||
//
|
|
||||||
// dependsOn(jvmJar)
|
|
||||||
//
|
|
||||||
// inputs.files(mainCompilation)
|
|
||||||
//
|
|
||||||
// classpath(
|
|
||||||
// jvmJar,
|
|
||||||
// mainCompilation,
|
|
||||||
// )
|
|
||||||
// mainClass.set("dev.adamko.kafkatorio.events.schema.Kt2ts2Kt")
|
|
||||||
//
|
|
||||||
// args(temporaryDir)
|
|
||||||
//
|
|
||||||
// val buildOutput = layout.buildDirectory.dir("generated/typescript")
|
|
||||||
// outputs.dir(buildOutput)
|
|
||||||
//
|
|
||||||
// doFirst {
|
|
||||||
// delete(temporaryDir)
|
|
||||||
// mkdir(temporaryDir)
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// doLast {
|
|
||||||
// sync {
|
|
||||||
// from(temporaryDir)
|
|
||||||
// into(buildOutput)
|
|
||||||
// include("**/*.ts")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
val schemaTsDistributionName: Provider<String> = providers.provider {
|
val schemaTsDistributionName: Provider<String> = providers.provider {
|
||||||
"${rootProject.name}-${project.name}"
|
"${rootProject.name}-${project.name}"
|
||||||
}
|
}
|
||||||
|
|
||||||
val generateTypescriptOutputFiles: Provider<FileTree> =
|
val generateTypeScriptOutputFiles: Provider<FileTree> =
|
||||||
generateTypescript.map { it.outputs.files.asFileTree }
|
generateTypeScript.map { it.outputs.files.asFileTree }
|
||||||
|
|
||||||
val schemaTs by distributions.registering {
|
val schemaTs by distributions.registering {
|
||||||
distributionBaseName.set(schemaTsDistributionName)
|
distributionBaseName.set(schemaTsDistributionName)
|
||||||
contents {
|
contents {
|
||||||
from(generateTypescriptOutputFiles)
|
from(generateTypeScriptOutputFiles)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val schemaTsZipTask: TaskProvider<Zip> = tasks.named<Zip>("${schemaTs.name}DistZip")
|
val schemaTsZipTask: TaskProvider<Zip> = tasks.named<Zip>("${schemaTs.name}DistZip")
|
||||||
val schemaTsZipTaskArchiveFile: Provider<RegularFile> = schemaTsZipTask.flatMap { it.archiveFile }
|
val schemaTsZipTaskArchiveFile: Provider<RegularFile> = schemaTsZipTask.flatMap { it.archiveFile }
|
||||||
|
|
||||||
val typescriptModelGenerated: Configuration by configurations.creating {
|
val typeScriptModelGenerated: Configuration by configurations.creating {
|
||||||
asProvider()
|
asProvider()
|
||||||
typescriptAttributes(objects)
|
typescriptAttributes(objects)
|
||||||
|
|
||||||
outgoing.artifact(schemaTsZipTaskArchiveFile)
|
outgoing.artifact(schemaTsZipTaskArchiveFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//tasks.matching {
|
|
||||||
// it.name == "jsGenerateExternalsIntegrated"
|
|
||||||
//}.configureEach {
|
|
||||||
// @Suppress("UnstableApiUsage")
|
|
||||||
// notCompatibleWithConfigurationCache("try to prevent 'Projects must be configuring' error")
|
|
||||||
//// outputs.upToDateWhen { true }
|
|
||||||
// dependsOn(":kotlinNpmInstall")
|
|
||||||
//}
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
import dev.adamko.kafkatorio.task.KafkaConsumerGroupsTask
|
import dev.adamko.kafkatorio.task.KafkaConsumerGroupsTask
|
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
dev.adamko.kafkatorio.lang.`kotlin-jvm`
|
dev.adamko.kafkatorio.lang.`kotlin-jvm`
|
||||||
kotlin("plugin.serialization")
|
kotlin("plugin.serialization")
|
||||||
application
|
application
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
description = """
|
description = """
|
||||||
Receive raw Factorio Events from Kafka and process them into targeted topics or data formats.
|
Receive raw Factorio Events from Kafka and process them into targeted topics or data formats.
|
||||||
|
|
||||||
|
|
@ -17,6 +19,7 @@ val projectId: String by project.extra
|
||||||
|
|
||||||
val kafkaStateDir: Directory = layout.projectDirectory.dir("kafka-state")
|
val kafkaStateDir: Directory = layout.projectDirectory.dir("kafka-state")
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(platform(projects.modules.versionsPlatform))
|
implementation(platform(projects.modules.versionsPlatform))
|
||||||
|
|
||||||
|
|
@ -49,9 +52,6 @@ dependencies {
|
||||||
implementation(libs.bundles.hoplite)
|
implementation(libs.bundles.hoplite)
|
||||||
}
|
}
|
||||||
|
|
||||||
//configurations.all {
|
|
||||||
// resolutionStrategy.cacheDynamicVersionsFor(1, TimeUnit.MINUTES)
|
|
||||||
//}
|
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClass.set("dev.adamko.kafkatorio.processor.EventProcessorKt")
|
mainClass.set("dev.adamko.kafkatorio.processor.EventProcessorKt")
|
||||||
|
|
@ -93,7 +93,3 @@ idea {
|
||||||
excludeDirs = excludeDirs + kafkaStateDir.asFile
|
excludeDirs = excludeDirs + kafkaStateDir.asFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//tasks.withType<KotlinNpmInstallTask>().all {
|
|
||||||
// notCompatibleWithConfigurationCache("error: Projects must be configuring")
|
|
||||||
//}
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import dev.adamko.kafkatorio.factoriomod.FactorioMod
|
||||||
import dev.adamko.kafkatorio.gradle.asConsumer
|
import dev.adamko.kafkatorio.gradle.asConsumer
|
||||||
import dev.adamko.kafkatorio.gradle.factorioModAttributes
|
import dev.adamko.kafkatorio.gradle.factorioModAttributes
|
||||||
import dev.adamko.kafkatorio.gradle.not
|
import dev.adamko.kafkatorio.gradle.not
|
||||||
|
|
@ -34,10 +35,11 @@ dependencies {
|
||||||
factorioMod(projects.modules.eventsMod)
|
factorioMod(projects.modules.eventsMod)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//<editor-fold desc="Mod deployment tasks">
|
//<editor-fold desc="Mod deployment tasks">
|
||||||
val deployModToClient by tasks.registering(Copy::class) {
|
val deployModToClient by tasks.registering(Copy::class) {
|
||||||
description = "Copy the mod to the Factorio client"
|
description = "Copy the mod to the Factorio client"
|
||||||
group = project.name
|
group = FactorioMod.TASK_GROUP
|
||||||
|
|
||||||
onlyIf { clientModsDirectory.orNull?.asFile?.exists() == true }
|
onlyIf { clientModsDirectory.orNull?.asFile?.exists() == true }
|
||||||
|
|
||||||
|
|
@ -50,13 +52,14 @@ val deployModToClient by tasks.registering(Copy::class) {
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
|
||||||
|
|
||||||
//<editor-fold desc="Factorio client lifecycle tasks">
|
//<editor-fold desc="Factorio client lifecycle tasks">
|
||||||
fun ExecOperations.isFactorioRunning(): Spec<Task> = ProcessRunningSpec(this, "factorio.exe")
|
fun ExecOperations.isFactorioRunning(): Spec<Task> = ProcessRunningSpec(this, "factorio.exe")
|
||||||
|
|
||||||
|
|
||||||
val clientLaunch by tasks.registering(Exec::class) {
|
val clientLaunch by tasks.registering(Exec::class) {
|
||||||
description = "Run Factorio Steam game client"
|
description = "Run local Factorio Steam game client"
|
||||||
group = project.name
|
group = FactorioMod.TASK_GROUP
|
||||||
|
|
||||||
onlyIf(!serviceOf<ExecOperations>().isFactorioRunning())
|
onlyIf(!serviceOf<ExecOperations>().isFactorioRunning())
|
||||||
onlyIf { steamExe.orNull?.asFile?.exists() == true }
|
onlyIf { steamExe.orNull?.asFile?.exists() == true }
|
||||||
|
|
@ -74,8 +77,8 @@ val clientLaunch by tasks.registering(Exec::class) {
|
||||||
}
|
}
|
||||||
|
|
||||||
val clientKill by tasks.registering(Exec::class) {
|
val clientKill by tasks.registering(Exec::class) {
|
||||||
description = "Run Factorio Steam game client"
|
description = "Stop the local Factorio Steam game client"
|
||||||
group = project.name
|
group = FactorioMod.TASK_GROUP
|
||||||
|
|
||||||
onlyIf(serviceOf<ExecOperations>().isFactorioRunning())
|
onlyIf(serviceOf<ExecOperations>().isFactorioRunning())
|
||||||
|
|
||||||
|
|
@ -84,7 +87,12 @@ val clientKill by tasks.registering(Exec::class) {
|
||||||
}
|
}
|
||||||
//</editor-fold>
|
//</editor-fold>
|
||||||
|
|
||||||
tasks.build { dependsOn(deployModToClient) }
|
|
||||||
|
tasks.register(FactorioMod.PUBLISH_MOD_LOCAL_TASK_NAME) {
|
||||||
|
group = FactorioMod.TASK_GROUP
|
||||||
|
dependsOn(deployModToClient)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
tasks.processRun {
|
tasks.processRun {
|
||||||
dependsOn(
|
dependsOn(
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import dev.adamko.kafkatorio.factoriomod.FactorioMod
|
||||||
import dev.adamko.kafkatorio.gradle.asConsumer
|
import dev.adamko.kafkatorio.gradle.asConsumer
|
||||||
import dev.adamko.kafkatorio.gradle.factorioModAttributes
|
import dev.adamko.kafkatorio.gradle.factorioModAttributes
|
||||||
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
||||||
|
|
@ -6,21 +7,25 @@ plugins {
|
||||||
dev.adamko.kafkatorio.infra.`docker-compose`
|
dev.adamko.kafkatorio.infra.`docker-compose`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val dockerSrcDir: Directory by extra
|
val dockerSrcDir: Directory by extra
|
||||||
val factorioServerDataDir: Directory = dockerSrcDir.dir("factorio-server")
|
val factorioServerDataDir: Directory = dockerSrcDir.dir("factorio-server")
|
||||||
|
|
||||||
|
|
||||||
val factorioMod: Configuration by configurations.creating {
|
val factorioMod: Configuration by configurations.creating {
|
||||||
asConsumer()
|
asConsumer()
|
||||||
factorioModAttributes(objects)
|
factorioModAttributes(objects)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
factorioMod(projects.modules.eventsMod)
|
factorioMod(projects.modules.eventsMod)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val deployModToServer by tasks.registering(Copy::class) {
|
val deployModToServer by tasks.registering(Copy::class) {
|
||||||
description = "Copy the mod to the Factorio Docker server"
|
description = "Copy the mod to the Factorio Docker server"
|
||||||
group = project.name
|
group = FactorioMod.TASK_GROUP
|
||||||
|
|
||||||
dependsOn(factorioMod)
|
dependsOn(factorioMod)
|
||||||
|
|
||||||
|
|
@ -34,10 +39,12 @@ val deployModToServer by tasks.registering(Copy::class) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tasks.dockerDown {
|
tasks.dockerDown {
|
||||||
commandLine = parseSpaceSeparatedArgs(""" docker-compose stop """)
|
commandLine = parseSpaceSeparatedArgs(""" docker-compose stop """)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tasks.dockerUp {
|
tasks.dockerUp {
|
||||||
dependsOn(
|
dependsOn(
|
||||||
deployModToServer,
|
deployModToServer,
|
||||||
|
|
@ -45,11 +52,16 @@ tasks.dockerUp {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tasks.dockerEnv {
|
tasks.dockerEnv {
|
||||||
properties("FACTORIO_VERSION" to libs.versions.factorio.get())
|
properties("FACTORIO_VERSION" to libs.versions.factorio.get())
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.build { dependsOn(deployModToServer) }
|
|
||||||
|
tasks.register(FactorioMod.PUBLISH_MOD_LOCAL_TASK_NAME) {
|
||||||
|
group = FactorioMod.TASK_GROUP
|
||||||
|
dependsOn(deployModToServer)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
idea {
|
idea {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import dev.adamko.kafkatorio.gradle.taskProvider
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
|
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
|
||||||
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
|
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
|
||||||
|
|
@ -17,6 +16,7 @@ kvision {
|
||||||
enableHiddenKotlinJsStore.set(false)
|
enableHiddenKotlinJsStore.set(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rootProject.extensions.configure<NodeJsRootExtension> {
|
rootProject.extensions.configure<NodeJsRootExtension> {
|
||||||
// https://github.com/rjaros/kvision/issues/410
|
// https://github.com/rjaros/kvision/issues/410
|
||||||
versions.webpackCli.version = "4.10.0"
|
versions.webpackCli.version = "4.10.0"
|
||||||
|
|
@ -48,13 +48,9 @@ afterEvaluate {
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
js(IR) {
|
js(IR) {
|
||||||
// browser()
|
|
||||||
// binaries.executable()
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// js("frontend", IR) {
|
|
||||||
// nodejs()
|
|
||||||
browser {
|
browser {
|
||||||
|
binaries.executable()
|
||||||
|
|
||||||
runTask {
|
runTask {
|
||||||
outputFileName = "main.bundle.js"
|
outputFileName = "main.bundle.js"
|
||||||
sourceMaps = false
|
sourceMaps = false
|
||||||
|
|
@ -87,16 +83,11 @@ kotlin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binaries.executable()
|
|
||||||
// compilations["main"].packageJson {
|
// compilations["main"].packageJson {
|
||||||
// this.devDependencies["webpack-dev-server"] = "4.9.1"
|
// this.devDependencies["webpack-dev-server"] = "4.9.1"
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// jvm("backend") {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|
||||||
all {
|
all {
|
||||||
|
|
@ -106,7 +97,6 @@ kotlin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// val commonMain by getting {
|
|
||||||
main {
|
main {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(dependencies.platform(libs.kotlinx.coroutines.bom))
|
implementation(dependencies.platform(libs.kotlinx.coroutines.bom))
|
||||||
|
|
@ -117,13 +107,6 @@ kotlin {
|
||||||
implementation(projects.modules.eventsSchema)
|
implementation(projects.modules.eventsSchema)
|
||||||
|
|
||||||
implementation(libs.kotlinx.html)
|
implementation(libs.kotlinx.html)
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// val jsMain by getting {
|
|
||||||
// dependsOn(commonMain)
|
|
||||||
//
|
|
||||||
// dependencies {
|
|
||||||
|
|
||||||
implementation(projects.modules.eventsSchema)
|
implementation(projects.modules.eventsSchema)
|
||||||
|
|
||||||
|
|
@ -154,37 +137,15 @@ kotlin {
|
||||||
// implementation(dependencies.platform(devNpm("webpack-dev-server", "4.9.1")))
|
// implementation(dependencies.platform(devNpm("webpack-dev-server", "4.9.1")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// val webDir = file("src/main/web")
|
|
||||||
resources.srcDir("src/main/web")
|
resources.srcDir("src/main/web")
|
||||||
// resources.srcDir("src/main/resources")
|
|
||||||
|
|
||||||
// kotlin.srcDir("src/main/kotlin")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// val frontendMain by getting {
|
|
||||||
// dependsOn(jsMain)
|
|
||||||
//// resources.srcDir("src/main/web")
|
|
||||||
//// resources.srcDir("src/main/resources")
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// val jsTest by getting {
|
|
||||||
// dependencies {
|
|
||||||
// implementation(kotlin("test-js"))
|
|
||||||
//
|
|
||||||
// kvision("kvision-testutils")
|
|
||||||
//
|
|
||||||
//// implementation(npm("karma", "^6.3.16"))
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// kotlin.srcDir("src/test/kotlin")
|
|
||||||
// }
|
|
||||||
|
|
||||||
test {
|
test {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-js"))
|
implementation(kotlin("test-js"))
|
||||||
|
|
||||||
kvision("kvision-testutils")
|
kvision("kvision-testutils")
|
||||||
|
|
||||||
// implementation(npm("karma", "^6.3.16"))
|
// implementation(npm("karma", "^6.3.16"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -221,22 +182,22 @@ fun KotlinDependencyHandler.kvision(
|
||||||
//evaluationDependsOn(projects.modules.eventsSchema.dependencyProject.path)
|
//evaluationDependsOn(projects.modules.eventsSchema.dependencyProject.path)
|
||||||
|
|
||||||
|
|
||||||
// stop warnings when building
|
//// stop warnings when building
|
||||||
tasks.configureEach {
|
//tasks.configureEach {
|
||||||
when (name) {
|
// when (name) {
|
||||||
"productionExecutableCompileSync" ->
|
// "productionExecutableCompileSync" ->
|
||||||
dependsOn(taskProvider("compileProductionExecutableKotlinJs"))
|
// dependsOn(taskProvider("compileProductionExecutableKotlinJs"))
|
||||||
"testTestDevelopmentExecutableCompileSync" ->
|
// "testTestDevelopmentExecutableCompileSync" ->
|
||||||
dependsOn(taskProvider("compileTestDevelopmentExecutableKotlinJs"))
|
// dependsOn(taskProvider("compileTestDevelopmentExecutableKotlinJs"))
|
||||||
// "jsTestTestDevelopmentExecutableCompileSync" ->
|
//// "jsTestTestDevelopmentExecutableCompileSync" ->
|
||||||
// dependsOn(taskProvider("compileTestDevelopmentExecutableKotlinFrontend"))
|
//// dependsOn(taskProvider("compileTestDevelopmentExecutableKotlinFrontend"))
|
||||||
// "jsProductionExecutableCompileSync" ->
|
//// "jsProductionExecutableCompileSync" ->
|
||||||
// dependsOn(taskProvider("compileProductionExecutableKotlinFrontend"))
|
//// dependsOn(taskProvider("compileProductionExecutableKotlinFrontend"))
|
||||||
"browserDevelopmentRun" ->
|
// "browserDevelopmentRun" ->
|
||||||
dependsOn(taskProvider("browserDevelopmentWebpack"))
|
// dependsOn(taskProvider("browserDevelopmentWebpack"))
|
||||||
"browserDevelopmentWebpack" ->
|
// "browserDevelopmentWebpack" ->
|
||||||
dependsOn(taskProvider("assemble"))
|
// dependsOn(taskProvider("assemble"))
|
||||||
"browserProductionWebpack" ->
|
// "browserProductionWebpack" ->
|
||||||
dependsOn(taskProvider("developmentExecutableCompileSync"))
|
// dependsOn(taskProvider("developmentExecutableCompileSync"))
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,5 @@ apply(from = "./buildSrc/repositories.settings.gradle.kts")
|
||||||
|
|
||||||
@Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature
|
@Suppress("UnstableApiUsage") // Central declaration of repositories is an incubating feature
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
|
|
||||||
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||||
|
|
||||||
// repositories {
|
|
||||||
// maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
|
|
||||||
//// content {
|
|
||||||
//// includeGroup("dev.adamko.kxstsgen")
|
|
||||||
//// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue