TheBrokenRail
7a4b9dd4f8
All checks were successful
ScriptCraft/pipeline/head This commit looks good
50 lines
1003 B
Groovy
50 lines
1003 B
Groovy
def typescriptRoot = 'src/main/ts'
|
|
def typescriptRootFile = new File(rootDir.absolutePath, typescriptRoot)
|
|
|
|
def typescriptOut = new File(typescriptRootFile, 'lib/ts')
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
|
|
task typescript(group: 'typescript', type: Exec) {
|
|
inputs.dir typescriptRootFile
|
|
outputs.dirs typescriptOut
|
|
|
|
workingDir typescriptRootFile
|
|
|
|
executable 'npm'
|
|
|
|
args 'run', 'build'
|
|
|
|
doFirst {
|
|
project.delete {
|
|
delete typescriptOut
|
|
}
|
|
}
|
|
}
|
|
|
|
typescript.dependsOn typescriptInstall
|
|
|
|
processResources.dependsOn typescript
|
|
|
|
processResources {
|
|
from(typescriptOut.absolutePath) {
|
|
into 'scriptcraft'
|
|
}
|
|
} |