TheBrokenRail
275ec8f2c6
Some checks failed
ScriptCraft/pipeline/head There was a failure building this commit
75 lines
1.4 KiB
Groovy
75 lines
1.4 KiB
Groovy
def typescriptRoot = 'src/main/ts'
|
|
def typescriptRootFile = new File(rootDir.absolutePath, typescriptRoot)
|
|
|
|
def typescriptOut = new File(typescriptRootFile, 'lib/ts')
|
|
def dtsOut = new File(typescriptRootFile, 'lib/dts')
|
|
|
|
task typescript(group: 'typescript', type: Exec) {
|
|
inputs.dir typescriptRootFile
|
|
outputs.dirs typescriptOut, dtsOut
|
|
|
|
workingDir typescriptRootFile
|
|
|
|
executable 'npm'
|
|
|
|
args 'run', 'build'
|
|
|
|
doFirst {
|
|
project.delete {
|
|
delete typescriptOut, dtsOut
|
|
}
|
|
}
|
|
}
|
|
|
|
task apiTar(group: 'typescript', type: Tar) {
|
|
into('/types') {
|
|
from new File(typescriptRootFile as File, 'src/types')
|
|
}
|
|
into('/lib') {
|
|
from dtsOut
|
|
}
|
|
from new File(typescriptRootFile as File, 'package.json')
|
|
|
|
classifier 'api'
|
|
}
|
|
|
|
apiTar.dependsOn typescript
|
|
|
|
artifacts {
|
|
archives apiTar
|
|
}
|
|
|
|
task eslint(group: 'typescript', type: Exec) {
|
|
workingDir typescriptRootFile
|
|
|
|
executable 'npm'
|
|
|
|
args 'run', 'eslint'
|
|
}
|
|
|
|
processResources.dependsOn typescript
|
|
|
|
def typedocOut = new File(typescriptRootFile, 'lib/typedoc')
|
|
|
|
task typedoc(group: 'typescript', type: Exec) {
|
|
inputs.dir typescriptRootFile
|
|
outputs.dir typedocOut
|
|
|
|
workingDir typescriptRootFile
|
|
|
|
executable 'npm'
|
|
|
|
args 'run', 'typedoc'
|
|
|
|
doFirst {
|
|
project.delete {
|
|
delete typedocOut
|
|
}
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
from(typescriptOut.absolutePath) {
|
|
into 'scriptcraft'
|
|
}
|
|
} |