mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-21 11:55:15 +01:00
add compileTs gradle task
This commit is contained in:
parent
3b0b538a15
commit
07e60e48ce
@ -176,6 +176,31 @@ tasks.named<ProcessResources>("processResources") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register<Exec>("compileTs") {
|
||||||
|
group = "build"
|
||||||
|
description = "Compiles TypeScript resources into JS"
|
||||||
|
workingDir = rootProject.rootDir
|
||||||
|
|
||||||
|
onlyIf {
|
||||||
|
val hasNpx = try {
|
||||||
|
val result = exec {
|
||||||
|
isIgnoreExitValue = true
|
||||||
|
commandLine("sh", "-c", "command -v npx")
|
||||||
|
}
|
||||||
|
result.exitValue == 0
|
||||||
|
} catch (e: Exception) {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasNpx) println("Command npx isn't available")
|
||||||
|
return@onlyIf hasNpx
|
||||||
|
}
|
||||||
|
|
||||||
|
commandLine("npx", "tsc")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.getByName("processResources").dependsOn("compileTs")
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
create<MavenPublication>("maven") {
|
create<MavenPublication>("maven") {
|
||||||
|
Loading…
Reference in New Issue
Block a user