added kvision web-map, cleaning up a few gradle things (tokens)
This commit is contained in:
parent
29d190b8f4
commit
6d60428ab9
31 changed files with 323 additions and 87 deletions
|
|
@ -5,6 +5,7 @@ import dev.adamko.kafkatorio.gradle.factorioModAttributes
|
|||
import dev.adamko.kafkatorio.gradle.typescriptAttributes
|
||||
import groovy.json.JsonOutput
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import org.jetbrains.kotlin.gradle.targets.js.npm.SemVer
|
||||
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
||||
|
||||
plugins {
|
||||
|
|
@ -23,16 +24,18 @@ description =
|
|||
val modName: String by extra("${rootProject.name}-events")
|
||||
val distributionZipName: String by extra("${modName}_${project.version}.zip")
|
||||
|
||||
// version of Factorio that the mod is compatible with (must only be "major.minor" - patch causes error)
|
||||
val modFactorioCompatibility = SemVer.from(libs.versions.factorio.get()).run { "$major.$minor" }
|
||||
|
||||
val tokens: MutableMap<String, String> by project.extra
|
||||
tokens += mapOf(
|
||||
val licenseFile: RegularFile by rootProject.extra
|
||||
val projectTokens: MutableMap<String, String> by rootProject.extra
|
||||
projectTokens += mapOf(
|
||||
"mod.name" to modName,
|
||||
"mod.title" to "Kafkatorio Events",
|
||||
"mod.description" to (project.description ?: ""),
|
||||
"factorio.version" to libs.versions.factorio.get().substringBeforeLast("."),
|
||||
"factorio.version" to modFactorioCompatibility,
|
||||
)
|
||||
|
||||
val licenseFile: RegularFile by project.extra
|
||||
val tsSrcDir: Directory = layout.projectDirectory.dir("src/main/typescript")
|
||||
|
||||
node {
|
||||
|
|
@ -52,7 +55,7 @@ val typescriptToLua by tasks.registering(NpmTask::class) {
|
|||
description = "Convert Typescript To Lua"
|
||||
group = project.name
|
||||
|
||||
dependsOn(tasks.npmInstall, fetchEventsSchema)
|
||||
dependsOn(tasks.npmInstall, installEventsSchema)
|
||||
|
||||
execOverrides { standardOutput = System.out }
|
||||
|
||||
|
|
@ -84,7 +87,7 @@ val typescriptToLua by tasks.registering(NpmTask::class) {
|
|||
|
||||
}
|
||||
|
||||
val fetchEventsSchema by tasks.registering(Sync::class) {
|
||||
val installEventsSchema by tasks.registering(Sync::class) {
|
||||
description = "Fetch the latest shared data-model"
|
||||
group = project.name
|
||||
|
||||
|
|
@ -124,10 +127,10 @@ distributions {
|
|||
}
|
||||
from(licenseFile)
|
||||
from(typescriptToLua.map { it.outputs })
|
||||
filter<ReplaceTokens>("tokens" to tokens)
|
||||
filter<ReplaceTokens>("tokens" to projectTokens)
|
||||
includeEmptyDirs = false
|
||||
exclude {
|
||||
// exclude empty lines
|
||||
// exclude empty files
|
||||
it.file.run {
|
||||
isFile && useLines { lines -> lines.all { line -> line.isBlank() } }
|
||||
}
|
||||
|
|
@ -196,7 +199,6 @@ val downloadFactorioApiDocs by tasks.registering {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
val factorioModProvider by configurations.registering {
|
||||
asProvider()
|
||||
factorioModAttributes(objects)
|
||||
|
|
@ -204,13 +206,11 @@ val factorioModProvider by configurations.registering {
|
|||
}
|
||||
|
||||
tasks.updatePackageJson {
|
||||
propertiesToCheck["name"] = "${rootProject.name}-${project.name}"
|
||||
propertiesToCheck.put("name", "${rootProject.name}-${project.name}")
|
||||
packageJsonFile.set(layout.projectDirectory.file("src/main/typescript/package.json"))
|
||||
}
|
||||
|
||||
tasks.assemble { dependsOn(fetchEventsSchema, tasks.updatePackageJson) }
|
||||
//tasks.build { dependsOn(packageMod) }
|
||||
|
||||
tasks.assemble { dependsOn(installEventsSchema, tasks.updatePackageJson) }
|
||||
|
||||
//
|
||||
//idea {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"version": "@project.version@",
|
||||
"title": "@mod.title@",
|
||||
"description": "@mod.description@",
|
||||
"author": "fredthedeadhead",
|
||||
"author": "@author.email@",
|
||||
"factorio_version": "@factorio.version@",
|
||||
"dependencies": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "kafkatorio-events-mod",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "kafkatorio-events-mod",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tstl",
|
||||
|
|
@ -9,8 +9,7 @@
|
|||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
},
|
||||
"devDependencies": {},
|
||||
"dependencies": {
|
||||
"lua-types": "^2.11.0",
|
||||
"@types/node": "^12.0.8",
|
||||
|
|
@ -21,10 +20,8 @@
|
|||
"//": {
|
||||
"typed-factorio": "0.10.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
},
|
||||
"optionalDependencies": {
|
||||
},
|
||||
"bundledDependencies": [
|
||||
]
|
||||
"license": "UNLICENSED",
|
||||
"peerDependencies": {},
|
||||
"optionalDependencies": {},
|
||||
"bundledDependencies": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
|
||||
// Generated code - do edit this file manually
|
||||
|
||||
// Generated by TypeScriptGenerator - do edit this file manually
|
||||
interface FactorioObjectData {
|
||||
object_name: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue