import Ġcom . github . ben man es . gradle . versions . updates . Dependency Updates Task Ċ import Ġorg . jetbrains . kotlin . cli . jvm . K 2 JVM Compiler Ċ import Ġorg . jetbrains . kotlin . config . Kotlin Compiler Version Ċ Ċ plugins Ġ{ ĊĠĠĠ Ġval Ġkotlin Version Ġ= Ġ" 1 . 6 . 0 " ĊĠĠĠ Ġkotlin (" jvm "). version ( kotlin Version ) ĊĠĠĠ Ġkotlin (" plugin . serialization "). version ( kotlin Version ) ĊĠĠĠ Ġ// Ġkotlin (" plugin . spring "). version ( kotlin Version ) ĊĠĠĠ Ġ// Ġid (" org . springframework . boot "). version (" 2 . 5 . 6 ") ĊĠĠĠ Ġ// Ġid (" io . spring . dependency - management "). version (" 1 . 0 . 1 1 . RELEASE ") ĊĠĠĠ Ġid (" com . github . john ren gel man . shadow "). version (" 7 . 1 . 0 ") ĊĠĠĠ Ġid (" com . github . ben - man es . versions "). version (" 0 . 3 9 . 0 ") ĊĠĠĠ Ġjava ĊĠĠĠ Ġapplication Ċ } Ċ Ċ repositories Ġ{ ĊĠĠĠ Ġgoogle () ĊĠĠĠ Ġmaven Central () ĊĠĠĠ Ġgradle Plugin Portal () Ċ } Ċ Ċ application Ġ{ ĊĠĠĠ Ġ// ĠDefine Ġthe Ġmain Ġclass Ġfor Ġthe Ġapplication . ĊĠĠĠ Ġmain ClassName Ġ= Ġ" Main Kt " Ċ } Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġ// Ġimplementation ( kotlin (" stdlib ")) ĊĠĠĠ Ġimplementation (" org . jetbrains . kotlin x : kotlin x - coroutines - core : 1 . 5 . 2 ") ĊĠĠĠ Ġimplementation (" org . jetbrains . kotlin x : kotlin x - serialization - json : 1 . 3 . 1 ") ĊĠĠĠ Ġval Ġk tor _ version Ġ= Ġ" 1 . 6 . 5 " ĊĠĠĠ Ġimplementation (" io . ktor : ktor - server - core :$ ktor _ version ") ĊĠĠĠ Ġimplementation (" io . ktor : ktor - server - netty :$ ktor _ version ") ĊĠĠĠ Ġ// Ġimplementation (" io . ktor : ktor - client - apache :$ ktor _ version ") ĊĠĠĠ Ġimplementation (" io . ktor : ktor - client - c io :$ ktor _ version ") ĊĠĠĠ Ġ// Ġimplementation (" io . ktor : ktor - client - java :$ ktor _ version ") ĊĠĠĠ Ġ// Ġimplementation (" io . ktor : ktor - client - jetty :$ ktor _ version ") ĊĠĠĠ Ġ// Ġimplementation (" io . ktor : ktor - client - okhttp :$ ktor _ version ") Ċ } Ċ Ċ tasks . register (" version ") Ġ{ ĊĠĠĠ Ġdo Last Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġhttps :// github . com / Jet Brains / kotlin / blob / master / compiler / cli / src / org / jetbrains / kotlin / cli / common / CLI Tool . kt # L 1 7 8 ĊĠĠĠĠĠĠĠ Ġval Ġj re Version Ġ= ĠSystem . getProperty (" java . runtime . version ") ĊĠĠĠĠĠĠĠ Ġprintln ("${ K 2 JVM Compiler (). executable Script FileName ()} Ġ${ Kotlin Compiler Version . VERSION } Ġ( J RE Ġ$ jre Version )") ĊĠĠĠ Ġ} Ċ } Ċ Ċ tasks . register (" du ") Ġ{ ĊĠĠĠ Ġdepends On (" dependency Updates ") Ċ } Ċ Ċ tasks . named < Dependency Updates Task >(" dependency Updates ") Ġ{ ĊĠĠĠ Ġreject Version If Ġ{ Ġis Non Stable ( candidate . version ) Ġ&& Ġ! is Non Stable ( current Version ) Ġ} ĊĠĠĠ Ġ// Ġoptional Ġparameters ĊĠĠĠ Ġcheck For Gradle Update Ġ= Ġtrue ĊĠĠĠ Ġoutput Formatter Ġ= Ġ" json " ĊĠĠĠ Ġoutput Dir Ġ= Ġ" build / dependency Updates " ĊĠĠĠ Ġreport fileName Ġ= Ġ" report " Ċ } Ċ Ċ fun Ġis Non Stable ( version : ĠString ): ĠBoolean Ġ{ ĊĠĠĠ Ġval Ġstable Keyword Ġ= ĠlistOf (" RELEASE ", Ġ" FINAL ", Ġ" GA "). any Ġ{ Ġversion . toUpperCase (). contains ( it ) Ġ} ĊĠĠĠ Ġval Ġregex Ġ= Ġ"^ [ 0 - 9 ,. v - ]+ (- r )? $ ". to Regex () ĊĠĠĠ Ġval Ġis Stable Ġ= Ġstable Keyword Ġ|| Ġregex . matches ( version ) ĊĠĠĠ Ġreturn Ġis Stable . not () Ċ } Ċ