TheBrokenRail
855fd08287
Some checks failed
ScriptCraft/pipeline/head There was a failure building this commit
64 lines
1.3 KiB
Groovy
64 lines
1.3 KiB
Groovy
def typescriptOut = new File(buildDir, 'generated/typescript')
|
|
|
|
def typescriptRoot = 'src/main/ts'
|
|
def typescriptRootFile = new File(rootDir.absolutePath, typescriptRoot)
|
|
|
|
task typescript(group: 'build') {
|
|
inputs.dir typescriptRootFile
|
|
outputs.dir typescriptOut
|
|
|
|
doFirst {
|
|
project.delete {
|
|
delete typescriptOut
|
|
}
|
|
typescriptOut.mkdirs()
|
|
|
|
project.exec {
|
|
workingDir typescriptRootFile
|
|
|
|
executable 'npm'
|
|
|
|
args 'run', 'build', '--'
|
|
args '--outDir', typescriptOut.absolutePath
|
|
}
|
|
}
|
|
}
|
|
|
|
task eslint(group: 'verification', type: Exec) {
|
|
workingDir typescriptRootFile
|
|
|
|
executable 'npm'
|
|
|
|
args 'run', 'eslint'
|
|
}
|
|
|
|
processResources.dependsOn typescript
|
|
|
|
def typedocOut = new File(buildDir, 'typedoc')
|
|
|
|
task typedoc(group: 'documentation') {
|
|
inputs.dir typescriptRootFile
|
|
outputs.dir typedocOut
|
|
|
|
doFirst {
|
|
project.delete {
|
|
delete typedocOut
|
|
}
|
|
typedocOut.mkdirs()
|
|
|
|
project.exec {
|
|
workingDir typescriptRootFile
|
|
|
|
executable 'npm'
|
|
|
|
args 'run', 'typedoc', '--'
|
|
args '--out', typedocOut.absolutePath
|
|
}
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
from(typescriptOut.absolutePath) {
|
|
into 'scriptcraft'
|
|
}
|
|
} |