/* Ċ Ġ* ĠCopyright Ġ 2 0 2 1 - 2 0 2 2 ĠThe ĠK oral ĠAuthors Ċ Ġ* ĠSPDX - License - Identifier : ĠApache - 2 . 0 Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ import Ġcom . diff plug . gradle . spot less . Kotlin Extension Ċ import Ġcom . diff plug . gradle . spot less . Kotlin Gradle Extension Ċ import Ġjava . util . regex . Pattern Ċ import Ġtools . a qua . default Format Ċ Ċ plugins Ġ{ ĊĠ Ġid (" tools . a qua . k oral . base - con ventions ") ĊĊĠ Ġid (" com . diff plug . spot less ") ĊĊĠ Ġ// Ġplugins Ġthat Ġmust Ġbe Ġapplied Ġto Ġthe Ġroot Ġproject ĊĠ Ġid (" io . github . gradle - nexus . publish - plugin ") ĊĠ Ġid (" me . q oom on . git - version ing ") ĊĠ Ġid (" org . jetbrains . kotlin x . k over ") Ċ } Ċ Ċ group Ġ= Ġ" tools . a qua " Ċ Ċ version Ġ= Ġ" 0 . 0 . 0 - SNAPSHOT " Ċ Ċ git Version ing . apply Ġ{ ĊĠ Ġdescribe Tag Pattern Ġ= ĠPattern . compile (" v (? < version > .* )") ĊĠ Ġrefs Ġ{ ĊĠĠĠ Ġconsider Tags On Branches Ġ= Ġtrue ĊĠĠĠ Ġtag (" v (? < version > .* )") Ġ{ Ġversion Ġ= Ġ"\ ${ ref . version }" Ġ} ĊĠĠĠ Ġbranch (" (( ?! main ). * | main .+ |) ") Ġ{ Ġ// Ġeverything Ġbut Ġmain ĊĠĠĠĠĠ Ġversion Ġ= ĊĠĠĠĠĠĠĠĠĠ Ġ"\ ${ describe . tag . version }- \ ${ ref . slug }- \ ${ describe . distance }- \ ${ commit . short }- SNAPSHOT " ĊĠĠĠ Ġ} ĊĠĠĠ Ġbranch (" main ") Ġ{ ĊĠĠĠĠĠ Ġversion Ġ= Ġ"\ ${ describe . tag . version }- \ ${ describe . distance }- \ ${ commit . short }- SNAPSHOT " ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ val Ġprint Version Ġby Ġtasks . register ing Ġ{ Ġlogger . error ( version . toString ()) Ġ} Ċ Ċ spot less Ġ{ ĊĠ Ġformat (" kotlin Build Src ", ĠKotlin Extension :: class . java ) Ġ{ ĊĠĠĠ Ġtarget (" build Src / src /*/ kotlin /**/*. kt ") ĊĠĠĠ Ġdefault Format ( root Project ) ĊĠ Ġ} ĊĠ Ġformat (" kotlin Gradle Build Src ", ĠKotlin Gradle Extension :: class . java ) Ġ{ ĊĠĠĠ Ġtarget (" build Src /*. gradle . k ts ", Ġ" build Src / src /*/ kotlin /**/*. gradle . k ts ") ĊĠĠĠ Ġdefault Format ( root Project ) ĊĠ Ġ} Ċ } Ċ Ċ nexus Publishing Ġ{ Ġrepositories Ġ{ Ġson atype () Ġ} Ġ} Ċ