package Ġcom . project . starter . easy launcher . plugin Ċ Ċ import Ġcom . android . build . gradle . App Extension Ċ import Ġcom . android . build . gradle . Library Extension Ċ import Ġcom . android . build . gradle . api . Base Variant Ċ import Ġorg . gradle . api . Domain Object Set Ċ import Ġorg . gradle . api . Project Ċ import Ġorg . gradle . api . model . ObjectFactory Ċ import Ġjava . io . File Ċ Ċ private Ġval Ġsupported Plugins Ġ= ĠlistOf ( ĊĠĠĠ Ġ" com . android . application ", ĊĠĠĠ Ġ" com . android . library ", Ċ ) Ċ Ċ internal Ġfun ĠProject . configure Supported Plugins ( block : Ġ( Domain Object Set < out ĠBase Variant >) Ġ-> ĠUnit ) Ġ{ ĊĠĠĠ Ġsupported Plugins . forEach Ġ{ Ġplugin Id Ġ-> ĊĠĠĠĠĠĠĠ Ġplugin Manager . with Plugin ( plugin Id ) Ġ{ Ġblock ( find Variants ()) Ġ} ĊĠĠĠ Ġ} Ċ } Ċ Ċ internal Ġfun ĠProject . find Variants (): ĠDomain Object Set < out ĠBase Variant > Ġ= ĊĠĠĠ Ġextensions . findBy Type ( App Extension :: class . java )?. application Variants ĊĠĠĠĠĠĠĠ Ġ?: Ġextensions . findBy Type ( Library Extension :: class . java )?. library Variants ĊĠĠĠĠĠĠĠ Ġ?: Ġthis . objects . domain Object Set ( Base Variant :: class . java ) Ċ Ċ internal Ġfun ĠObject Factory . get Icon Files ( parent : ĠFile , Ġicon Name : ĠString ): ĠIterable < File > Ġ= ĊĠĠĠ Ġfile Tree (). from ( parent ). apply Ġ{ ĊĠĠĠĠĠĠĠ Ġinclude ( resource File Pattern ( icon Name )) ĊĠĠĠ Ġ} Ċ Ċ private Ġfun Ġresource File Pattern ( name : ĠString ): ĠString Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( name . startsWith ("@ ")) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġ( base Res Type , ĠfileName ) Ġ= Ġname . substring ( 1 ). split ("/ ". to Regex (), Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġ"$ base Res Type */ $ fileName .* " ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠ Ġname ĊĠĠĠ Ġ} Ċ } Ċ