import Ġcom . av ito . android . Check Wrapper Ċ import Ġcom . av ito . android . resolve Dir Ċ Ċ /** Ċ Ġ* ĠS ymlink s Ġwould Ġbe Ġbetter , Ġbut Ġneed Ġa Ġplatform Ġindependent Ġway Ċ Ġ*/ Ċ val Ġcopy Wrapper Tasks Ġ= Ġgradle . included Build s . map Ġ{ Ġbuild Ġ-> ĊĠĠĠ Ġval ĠprojectName Slug Ġ= Ġmake ProjectName Suit able For Task Name Slug ( build . name ) ĊĊĠĠĠ Ġtasks . register < Copy >(" copy ${ projectName Slug } Wrapper ") Ġ{ ĊĠĠĠĠĠĠĠ Ġfrom ("$ rootDir / gradle / wrapper ") ĊĠĠĠĠĠĠĠ Ġinto ("${ build . project Dir }/ gradle / wrapper ") ĊĠĠĠ Ġ} Ċ } Ċ Ċ val Ġincluded Project Dirs Ġ= Ġprovider Ġ{ ĊĠĠĠ Ġgradle . included Build s ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġit . project Dir Ġ} ĊĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġproject . resolve Dir ( it ) Ġ} Ċ } Ċ Ċ val Ġall Project Dirs Provider : ĠProvider < List < Directory >> Ġ= Ġincluded Project Dirs . map Ġ{ Ġit Ġ+ Ġlayout . project Directory Ġ} Ċ Ċ val Ġgradle Ver Ġ= Ġ" 7 . 2 " Ċ val Ġdistribution Ġ= ĠWrapper . Distribution Type . BIN Ċ Ċ /** Ċ Ġ* ĠTests Ġrun Ġfrom ĠIDE Ġin Ġincluded Ġbuilds Ġcan 't Ġrecognize Ġroot Ġwrapper Ċ Ġ* Ġhttps :// yout rack . jetbrains . com / issue / IDE A - 2 6 2 5 2 8 Ċ Ġ*/ Ċ tasks . with Type < Wrapper >(). configure Each Ġ{ ĊĠĠĠ Ġdistribution Type Ġ= Ġdistribution ĊĠĠĠ Ġgradle Version Ġ= Ġgradle Ver ĊĊĠĠĠ Ġfinal ized By ( copy Wrapper Tasks ) Ċ } Ċ Ċ tasks . register < Check Wrapper >(" check Gradle Wrappers ") Ġ{ ĊĠĠĠ Ġgroup Ġ= Ġ" Build Ġsetup " ĊĠĠĠ Ġdescription Ġ= Ġ" Checks Ġgradle - wrapper . properties Ġconsistency Ġfor Ġall Ġincluded Ġbuilds " ĊĊĠĠĠ Ġexpected Gradle Version . set ( gradle Ver ) ĊĠĠĠ Ġexpected Distribution Type . set ( distribution ) ĊĠĠĠ Ġproject Dirs . set ( all Project Dirs Provider ) Ċ } Ċ Ċ fun Ġmake ProjectName Suit able For Task Name Slug ( projectName : ĠString ): ĠString Ġ{ ĊĠĠĠ Ġreturn ĠprojectName . split ( Regex ("[ ^ a - zA - Z 0 - 9 ] ")). join ToString ( separator Ġ= Ġ"") Ġ{ Ġit . capitalize () Ġ} Ċ } Ċ