Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
95 lines (73 sloc) 1.58 KB
apply plugin: 'com.moowork.node'
apply plugin: 'java'
node {
version = '8.9.1'
yarnVersion = '1.6.0'
download = true
}
configurations {
typescriptGenRuntime
}
dependencies {
typescriptGenRuntime project(':crnk-example-service')
}
apply plugin: 'crnk-gen-typescript'
typescriptGen {
generateExpressions = true
genDir = file('src/resources')
runtime {
configuration = 'typescriptGenRuntime'
spring {
profile = 'test'
configuration = 'io.crnk.example.service.ExampleConfiguration'
}
}
}
typescriptGen.init()
generateTypescript.dependsOn ':crnk-example-service:jar'
task yarnRunStart(type: YarnTask) {
group = 'node'
dependsOn yarn
yarnCommand = ['run', 'start']
}
task yarnRunBuild(type: YarnTask) {
group = 'node'
dependsOn yarn
dependsOn generateTypescript
yarnCommand = ['run', 'build']
inputs.dir 'src'
inputs.files 'angular-cli.json', 'package.json'
outputs.dir 'build/angular/static'
}
task yarnStart(type: YarnTask) {
dependsOn yarn
yarnCommand = ['run', 'start']
}
task lint(type: YarnTask) {
description = "Run TSLint code analysis"
group = "Verification"
dependsOn yarn
yarnCommand = ['run', 'lint']
inputs.dir 'src/app'
def uptodateMarkerFile = file "${buildDir}/tslint.uptodate"
outputs.files uptodateMarkerFile
doLast {
uptodateMarkerFile.with {
parentFile.mkdir()
createNewFile()
write System.currentTimeMillis() as String
}
}
}
assemble.dependsOn 'yarnRunBuild'
check.dependsOn lint
clean.doFirst {
delete "node_modules/"
}
sourceSets {
main {
resources {
srcDir yarnRunBuild.outputs.files.singleFile.parentFile
}
}
}