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/typescript.build.gradle

64 lines
1.3 KiB
Groovy
Raw Normal View History

2020-04-28 14:16:47 +00:00
def typescriptOut = new File(buildDir, 'generated/typescript')
2020-04-28 16:44:44 +00:00
def typescriptRoot = 'src/main/ts'
2020-04-28 14:16:47 +00:00
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', '--'
2020-04-28 16:44:44 +00:00
args '--outDir', typescriptOut.absolutePath
2020-04-28 14:16:47 +00:00
}
}
}
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 {
2020-04-28 16:44:44 +00:00
from(typescriptOut.absolutePath) {
into 'scriptcraft'
}
2020-04-28 14:16:47 +00:00
}