enable gradle build cache, and improve tasks
This commit is contained in:
parent
f339333f76
commit
b81e62e2fd
17 changed files with 330 additions and 200 deletions
|
|
@ -39,6 +39,7 @@ projectTokens += mapOf(
|
|||
|
||||
val tsSrcDir: Directory = layout.projectDirectory.dir("src/main/typescript")
|
||||
|
||||
|
||||
node {
|
||||
nodeProjectDir.set(tsSrcDir)
|
||||
}
|
||||
|
|
@ -49,28 +50,20 @@ val typescriptEventsSchema: Configuration by configurations.creating {
|
|||
typescriptAttributes(objects)
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
typescriptEventsSchema(projects.modules.eventsSchema)
|
||||
}
|
||||
|
||||
|
||||
val typescriptToLua by tasks.registering(TypescriptToLuaTask::class) {
|
||||
dependsOn(tasks.npmInstall, installEventsTsSchema, tasks.updatePackageJson)
|
||||
|
||||
sourceFiles.set(tsSrcDir)
|
||||
outputDirectory.set(layout.buildDirectory.dir("typescriptToLua"))
|
||||
|
||||
doFirst("cleanTemporaryDir") {
|
||||
delete(temporaryDir)
|
||||
mkdir(temporaryDir)
|
||||
}
|
||||
doLast("syncTstlOutput") {
|
||||
sync {
|
||||
from(temporaryDir)
|
||||
into(outputDirectory)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val installEventsTsSchema by tasks.registering(Sync::class) {
|
||||
description = "Fetch the latest shared data-model"
|
||||
group = project.name
|
||||
|
|
@ -100,10 +93,13 @@ val installEventsTsSchema by tasks.registering(Sync::class) {
|
|||
into(outputDir)
|
||||
}
|
||||
|
||||
|
||||
tasks.distZip {
|
||||
archiveFileName.set(distributionZipName)
|
||||
archiveFileName.set(provider { distributionZipName })
|
||||
|
||||
}
|
||||
|
||||
|
||||
distributions {
|
||||
main {
|
||||
|
||||
|
|
@ -165,11 +161,13 @@ val factorioModProvider by configurations.registering {
|
|||
outgoing.artifact(tasks.distZip.flatMap { it.archiveFile })
|
||||
}
|
||||
|
||||
|
||||
tasks.updatePackageJson {
|
||||
propertiesToCheck.put("name", "${rootProject.name}-${project.name}")
|
||||
propertiesToCheck.put("name", providers.provider { "${rootProject.name}-${project.name}" })
|
||||
packageJsonFile.set(layout.projectDirectory.file("src/main/typescript/package.json"))
|
||||
}
|
||||
|
||||
|
||||
tasks.assemble { dependsOn(installEventsTsSchema, tasks.updatePackageJson) }
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue