import Ġorg . jetbrains . kotlin . gradle . tasks . Kotlin Compile Ċ import Ġcom . mo ow ork . gradle . node . npm . N pm Task Ċ Ċ plugins Ġ{ Ċ ĉ id (" org . springframework . boot ") Ġversion Ġ" 2 . 3 . 0 . RELEASE " Ċ ĉ id (" io . spring . dependency - management ") Ġversion Ġ" 1 . 0 . 9 . RELEASE " Ċ ĉ id (" com . github . node - gradle . node ") Ġversion Ġ" 2 . 2 . 2 " Ċ ĉ kotlin (" jvm ") Ġversion Ġ" 1 . 3 . 7 2 " Ċ ĉ kotlin (" plugin . spring ") Ġversion Ġ" 1 . 3 . 7 2 " Ċ } Ċ Ċ group Ġ= Ġ" mate jm are cek . demo " Ċ version Ġ= Ġ" 0 . 0 . 1 - SNAPSHOT " Ċ java . source Compatibility Ġ= ĠJava Version . VERSION _ 1 1 Ċ Ċ repositories Ġ{ Ċ ĉ maven Central () Ċ } Ċ Ċ dependencies Ġ{ Ċ ĉ implementation (" org . springframework . boot : spring - boot - starter - web ") Ċ ĉ implementation (" org . springframework . boot : spring - boot - starter - websocket ") Ċ ĉ implementation (" com . fasterxml . jackson . module : jackson - module - kotlin ") Ċ ĉ implementation (" org . jetbrains . kotlin : kotlin - reflect ") Ċ ĉ implementation (" org . jetbrains . kotlin : kotlin - stdlib - jdk 8 ") Ċ ĉ implementation (" org . jetbrains . kotlin x : kotlin x - coroutines - core : 1 . 1 . 0 ") Ċ ĉ development Only (" org . springframework . boot : spring - boot - devtools ") Ċ ĉ test Implementation (" org . springframework . boot : spring - boot - starter - test ") Ġ{ Ċĉ ĉ exclude ( group Ġ= Ġ" org . junit . vint age ", Ġmodule Ġ= Ġ" junit - vint age - engine ") Ċ ĉ } Ċ } Ċ Ċ tasks . with Type < Test > Ġ{ Ċ ĉ use JUnit Platform () Ċ } Ċ Ċ tasks . with Type < Kotlin Compile > Ġ{ Ċ ĉ depends On (" copy Frontend ") Ċ ĉ kotlin Options Ġ{ Ċĉ ĉ free Compiler Args Ġ= ĠlistOf ("- X js r 3 0 5 = strict ") Ċĉ ĉ jvm Target Ġ= Ġ" 1 . 8 " Ċ ĉ } Ċ } ĊĊ Ċ tasks . register < N pm Task >(" app N pm Install ") Ġ{ Ċ ĉ description Ġ= Ġ" Install s Ġall Ġdependencies Ġfrom Ġpackage . json " Ċ ĉ working Dir Ġ= Ġfile ("${ project . project Dir }/ src / main / frontend ") Ċ ĉ args Ġ= ĠlistOf (" install ") Ċ } Ċ Ċ tasks . register < N pm Task >(" app N pm Build ") Ġ{ Ċ ĉ depends On (" app N pm Install ") Ċ ĉ description Ġ= Ġ" Build s Ġproject " Ċ ĉ working Dir Ġ= Ġfile ("${ project . project Dir }/ src / main / frontend ") Ċ ĉ args Ġ= ĠlistOf (" run ", Ġ" build ") Ċ } Ċ Ċ tasks . register < Copy >(" copy Frontend ") Ġ{ Ċ ĉ depends On (" app N pm Build ") Ċ ĉ description Ġ= Ġ" Cop ies Ġbuilt Ġproject Ġto Ġwhere Ġit Ġwill Ġbe Ġserved " Ċ ĉ from (" src / main / frontend / build ") Ċ ĉ into (" build / resources / main / static /. ") Ċ } Ċ Ċ node Ġ{ Ċ ĉ download Ġ= Ġtrue Ċ ĉ version Ġ= Ġ" 1 0 . 1 5 . 3 " Ċ ĉ npm Version Ġ= Ġ" 6 . 4 . 1 " ĊĊ ĉ // ĠSet Ġthe Ġwork Ġdirectory Ġfor Ġunpack ing Ġnode Ċ ĉ work Dir Ġ= Ġfile ("${ project . build Dir }/ nodejs ") ĊĊ ĉ // ĠSet Ġthe Ġwork Ġdirectory Ġfor ĠNPM Ċ ĉ npm Work Dir Ġ= Ġfile ("${ project . build Dir }/ npm ") Ċ }