plugins Ġ{ Ċ ĉ kotlin (" jvm ") Ċ ĉ id (" application ") Ċ } Ċ Ċ application Ġ{ Ċ ĉ main ClassName Ġ= Ġ" org . jel ly fin . openapi . Main Kt " Ċ } Ċ Ċ dependencies Ġ{ Ċ ĉ // ĠReading ĠOpenAPI Ċ ĉ implementation ( Dependencies . swagger Parser ) ĊĊ ĉ // ĠCap ital ization Ġhelper Ċ ĉ implementation ( Dependencies . k ase change ) ĊĊ ĉ // ĠKotlin Ġcode Ġgeneration Ċ ĉ implementation ( Dependencies . kotlin Po et ) ĊĊ ĉ // ĠN eeded Ġfor Ġthe Ġkotlinx . serialization Ġannotations Ċ ĉ implementation ( Dependencies . Kotlin X . serialization Json ) ĊĊ ĉ // ĠN eeded Ġfor Ġthe ĠByte Read Channel Ġclass Ċ ĉ implementation ( Dependencies . K tor . io ) ĊĊ ĉ // ĠDependency ĠInjection Ċ ĉ implementation ( Dependencies . K oin . core ) ĊĊ ĉ // ĠTesting Ċ ĉ test Implementation ( Dependencies . Kotlin . Test . junit ) Ċ } Ċ Ċ task (" generate Sources ", ĠJava Exec :: class ) Ġ{ Ċ ĉ main Ġ= Ġapplication . main ClassName Ċ ĉ classpath Ġ= Ġsource Sets . main . get (). runtime Classpath ĊĊ ĉ args Ġ= Ġmap Of ( Ċĉ ĉ " open Api File " Ġto Ġfile ("../ openapi . json "), Ċĉ ĉ " api Output Dir " Ġto Ġfile ("../ jel ly fin - api / src / main / kotlin - generated "), Ċĉ ĉ " models Output Dir " Ġto Ġfile ("../ jel ly fin - model / src / main / kotlin - generated ") Ċ ĉ ). map Ġ{ ĠlistOf ("-- ${ it . key }", Ġit . value . toString ()) Ġ}. flatten () Ċ } Ċ