fix(build/composer): npx command (#1159)

Co-authored-by: w451 <cheb>
This commit is contained in:
w451 2024-07-04 15:47:30 -04:00 committed by GitHub
parent bf49bcbe11
commit bc4498e13c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
import org.apache.tools.ant.taskdefs.condition.Os
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinAndroid)
@ -16,12 +17,22 @@ android {
task("compileTypeScript") {
doLast {
project.exec {
commandLine("npx", "--yes", "tsc", "--project", "tsconfig.json")
}
project.exec {
commandLine("npx", "--yes", "rollup", "--config", "rollup.config.js", "--bundleConfigAsCjs")
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
project.exec {
commandLine("npx.cmd", "--yes", "tsc", "--project", "tsconfig.json")
}
project.exec {
commandLine("npx.cmd", "--yes", "rollup", "--config", "rollup.config.js", "--bundleConfigAsCjs")
}
} else {
project.exec {
commandLine("npx", "--yes", "tsc", "--project", "tsconfig.json")
}
project.exec {
commandLine("npx", "--yes", "rollup", "--config", "rollup.config.js", "--bundleConfigAsCjs")
}
}
project.copy {
from("build/loader.js")
into("build/assets/composer")
@ -31,4 +42,4 @@ task("compileTypeScript") {
tasks.named("preBuild").configure {
dependsOn("compileTypeScript")
}
}