get a shared kotlin-typescript data model working
This commit is contained in:
parent
d6a9a58dc9
commit
0d85bfca60
10 changed files with 173 additions and 178 deletions
|
|
@ -1,4 +1,6 @@
|
|||
import com.github.gradle.node.npm.task.NpmTask
|
||||
import dev.adamko.factoriowebmap.configurations.asConsumer
|
||||
import dev.adamko.factoriowebmap.configurations.typescriptAttributes
|
||||
import org.apache.tools.ant.filters.ReplaceTokens
|
||||
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs
|
||||
|
||||
|
|
@ -53,6 +55,35 @@ val tstlTask = tasks.register<NpmTask>("typescriptToLua") {
|
|||
|
||||
}
|
||||
|
||||
val dataModelTs: Configuration by configurations.creating {
|
||||
asConsumer()
|
||||
typescriptAttributes(objects)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
dataModelTs(projects.modules.factorioEventsDataModel)
|
||||
}
|
||||
|
||||
val updateDataModel by tasks.registering(Sync::class) {
|
||||
group = project.name
|
||||
|
||||
dependsOn(dataModelTs)
|
||||
|
||||
from(
|
||||
dataModelTs.incoming
|
||||
.artifactView { lenient(true) }
|
||||
.artifacts
|
||||
.artifactFiles
|
||||
.filter { it.exists() }
|
||||
)
|
||||
|
||||
into(layout.projectDirectory.dir("src/main/typescript/generated"))
|
||||
}
|
||||
|
||||
tasks.assemble { dependsOn(updateDataModel) }
|
||||
|
||||
|
||||
|
||||
idea {
|
||||
module {
|
||||
sourceDirs.add(mkdir(layout.projectDirectory.dir("src/main/typescript").asFile))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue