plugins Ġ{ ĊĠĠĠ Ġkotlin (" jvm ") Ġversion Ġ" 1 . 5 . 2 1 " ĊĠĠĠ Ġapplication ĊĠĠĠ Ġid (" org . ber yx . runtime ") Ġversion Ġ" 1 . 1 2 . 5 " Ċ } Ċ Ċ repositories Ġ{ ĊĠĠĠ Ġmaven Central () ĊĠĠĠ Ġmaven (" https :// kotlin . bin tray . com / ktor ") Ċ } Ċ Ċ application Ġ{ ĊĠĠĠ Ġmain ClassName Ġ= Ġ" io . github . leg ion 2 . to sca _ orche strator . cli . Main Kt " ĊĠĠĠ Ġexecutable Dir Ġ= Ġ"" ĊĠĠĠ Ġapplication Name Ġ= Ġ" rit am " Ċ } Ċ Ċ runtime Ġ{ ĊĠĠĠ Ġadd Options ("-- strip - debug ", Ġ"-- compress ", Ġ" 2 ", Ġ"-- no - header - files ", Ġ"-- no - man - pages ") ĊĠĠĠ Ġadd Modules (" java . base ", Ġ" java . net . http ") ĊĊĠĠĠ Ġimage Zip . set ( file ("$ build Dir /${ project . application . application Name }. zip ")) ĊĠĠĠ Ġtarget Platform (" linux - x 6 4 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġset J dk Home ( jdk Download (" https :// github . com / A dopt OpenJDK / openjdk 1 4 - binaries / releases / download / jdk - 1 4 . 0 . 2 % 2 B 1 2 / OpenJDK 1 4 U - jdk _ x 6 4 _ linux _ hot spot _ 1 4 . 0 . 2 _ 1 2 . tar . gz ")) ĊĠĠĠ Ġ} ĊĠĠĠ Ġtarget Platform (" linux - aarch 6 4 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġset J dk Home ( jdk Download (" https :// github . com / A dopt OpenJDK / openjdk 1 4 - binaries / releases / download / jdk - 1 4 . 0 . 2 % 2 B 1 2 / OpenJDK 1 4 U - jdk _ aarch 6 4 _ linux _ hot spot _ 1 4 . 0 . 2 _ 1 2 . tar . gz ")) ĊĠĠĠ Ġ} ĊĠĠĠ Ġtarget Platform (" linux - arm 3 2 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġset J dk Home ( jdk Download (" https :// github . com / A dopt OpenJDK / openjdk 1 4 - binaries / releases / download / jdk - 1 4 . 0 . 2 % 2 B 1 2 / OpenJDK 1 4 U - jdk _ arm _ linux _ hot spot _ 1 4 . 0 . 2 _ 1 2 . tar . gz ")) ĊĠĠĠ Ġ} ĊĠĠĠ Ġtarget Platform (" windows - x 6 4 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġset J dk Home ( jdk Download (" https :// github . com / A dopt OpenJDK / openjdk 1 4 - binaries / releases / download / jdk - 1 4 . 0 . 2 % 2 B 1 2 / OpenJDK 1 4 U - jdk _ x 6 4 _ windows _ hot spot _ 1 4 . 0 . 2 _ 1 2 . zip ")) ĊĠĠĠ Ġ} ĊĠĠĠ Ġtarget Platform (" mac - x 6 4 ") Ġ{ ĊĠĠĠĠĠĠĠ Ġset J dk Home ( jdk Download (" https :// github . com / A dopt OpenJDK / openjdk 1 4 - binaries / releases / download / jdk - 1 4 . 0 . 2 % 2 B 1 2 / OpenJDK 1 4 U - jdk _ x 6 4 _ mac _ hot spot _ 1 4 . 0 . 2 _ 1 2 . tar . gz ")) ĊĠĠĠ Ġ} Ċ } Ċ Ċ val Ġk tor Version Ġ= Ġ" 1 . 6 . 2 " Ċ val Ġcli kt Version Ġ= Ġ" 3 . 2 . 0 " Ċ val Ġj ack son Version Ġ= Ġ" 2 . 1 2 . 4 " Ċ val Ġjson Patch Version Ġ= Ġ" 1 . 1 3 " Ċ Ċ dependencies Ġ{ ĊĠĠĠ Ġimplementation (" com . github . aj alt . cli kt : cli kt :$ cli kt Version ") ĊĠĠĠ Ġimplementation (" io . ktor : ktor - client :$ ktor Version ") ĊĠĠĠ Ġimplementation (" io . ktor : ktor - client - java :$ ktor Version ") ĊĠĠĠ Ġimplementation (" io . ktor : ktor - client - json :$ ktor Version ") ĊĠĠĠ Ġimplementation (" io . ktor : ktor - client - jackson :$ ktor Version ") ĊĠĠĠ Ġimplementation (" com . fasterxml . jackson . data format : jackson - data format - yaml :$ jackson Version ") ĊĠĠĠ Ġimplementation (" com . github . java - json - tools : json - patch :$ json Patch Version ") Ċ } Ċ Ċ tasks . with Type < org . jetbrains . kotlin . gradle . tasks . Kotlin Compile > Ġ{ ĊĠĠĠ Ġkotlin Options Ġ{ ĊĠĠĠĠĠĠĠ Ġj vm Target Ġ= Ġ" 1 4 " ĊĠĠĠĠĠĠĠ Ġlanguage Version Ġ= Ġ" 1 . 4 " ĊĠĠĠĠĠĠĠ ĠapiVersion Ġ= Ġ" 1 . 4 " ĊĠĠĠ Ġ} Ċ } Ċ Ċ val Ġgenerate Cli Comp letions Ġby Ġtasks . register ing ( Java Exec :: class ) Ġ{ ĊĠĠĠ Ġdepends On (" classes ") ĊĠĠĠ Ġclasspath Ġ= Ġsource Sets . main . get (). runtime Classpath ĊĠĠĠ Ġmain Ġ= Ġapplication . main ClassName ĊĠĠĠ Ġenvironment (" R IT AM _ CLI _ COMPLETE ", Ġ" bash ") ĊĊĠĠĠ Ġval Ġcomplet ions Ġ= Ġfile ("$ build Dir / comp letions ") ĊĠĠĠ Ġoutputs . dir ( comp letions ) ĊĠĠĠ Ġdo First Ġ{ ĊĠĠĠĠĠĠĠ Ġcomplet ions . mkdir s () ĊĠĠĠĠĠĠĠ Ġstandard Output Ġ= ĠFile ( comp letions , Ġ" bash - complete - rit am . sh "). output Stream () ĊĠĠĠ Ġ} Ċ } Ċ Ċ distributions Ġ{ ĊĠĠĠ Ġmain Ġ{ ĊĠĠĠĠĠĠĠ Ġcontents Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfrom ( generate Cli Comp letions ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ tasks . with Type < Wrapper > Ġ{ ĊĠĠĠ Ġgradle Version Ġ= Ġ" 6 . 6 " ĊĠĠĠ Ġdistribution Type Ġ= ĠWrapper . Distribution Type . ALL Ċ } Ċ