This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
ScriptCraft/examples/typescript/typescript.build.gradle

50 lines
1003 B
Groovy
Raw Normal View History

2020-04-29 18:56:51 +00:00
def typescriptRoot = 'src/main/ts'
def typescriptRootFile = new File(rootDir.absolutePath, typescriptRoot)
def typescriptOut = new File(typescriptRootFile, 'lib/ts')
2020-04-29 23:41:08 +00:00
def nodeModules = new File(typescriptRoot, 'node_modules')
task typescriptInstall(group: 'typescript', type: Exec) {
inputs.file new File(typescriptRootFile, 'package.json')
outputs.dir nodeModules
workingDir typescriptRootFile
executable 'npm'
args 'install'
doFirst {
project.delete {
delete nodeModules
}
}
}
2020-04-29 18:56:51 +00:00
task typescript(group: 'typescript', type: Exec) {
inputs.dir typescriptRootFile
outputs.dirs typescriptOut
workingDir typescriptRootFile
executable 'npm'
args 'run', 'build'
doFirst {
project.delete {
delete typescriptOut
}
}
}
2020-04-29 23:41:08 +00:00
typescript.dependsOn typescriptInstall
2020-04-29 18:56:51 +00:00
processResources.dependsOn typescript
processResources {
from(typescriptOut.absolutePath) {
into 'scriptcraft'
}
}