/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 8 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* Ġ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 . Ċ Ġ*/ Ċ package Ġcom . android . tools . idea . gradle . structure . model . android Ċ Ċ import Ġcom . android . tools . idea . gradle . dsl . api . dependencies . Dependency Model Ċ import Ġcom . android . tools . idea . gradle . dsl . api . dependencies . File Dependency Model Ċ import Ġcom . android . tools . idea . gradle . dsl . api . dependencies . File Tree Dependency Model Ċ import Ġcom . android . tools . idea . gradle . dsl . api . ext . Resolved Property Model Ċ import Ġcom . android . tools . idea . gradle . structure . model . Ps Declared Jar Dependency Ċ import Ġcom . android . tools . idea . gradle . structure . model . Ps Jar Dependency Ċ import Ġcom . android . tools . idea . gradle . structure . model . Ps Resolved Jar Dependency Ċ import Ġcom . android . tools . idea . gradle . structure . model . meta . Model Descriptor Ċ import Ġcom . android . tools . idea . gradle . structure . model . meta . Model Property Ċ import Ġcom . android . tools . idea . gradle . structure . model . meta . asString Ċ import Ġcom . android . tools . idea . gradle . structure . model . meta . getValue Ċ Ċ class ĠP s Declared Jar Android Dependency Ġconstructor ( ĊĠ Ġparent : ĠP s Android Module Ċ ) Ġ: ĠP s Jar Android Dependency ( parent ), ĠP s Declared Jar Dependency Ġ{ ĊĠ Ġoverride Ġlateinit Ġvar Ġparsed Model : ĠDependency Model Ġ; Ġprivate Ġset ĊĊĠ Ġfun Ġinit ( parsed Model : ĠFile Dependency Model ) Ġ{ ĊĠĠĠ Ġthis . parsed Model Ġ= Ġparsed Model ĊĠ Ġ} ĊĊĠ Ġfun Ġinit ( parsed Model : ĠFile Tree Dependency Model ) Ġ{ ĊĠĠĠ Ġthis . parsed Model Ġ= Ġparsed Model ĊĠ Ġ} ĊĊĠ Ġoverride Ġval Ġdescriptor Ġby ĠP s Declared Jar Android Dependency . Descriptor ĊĠ Ġoverride Ġval Ġkind : ĠP s Jar Dependency . Kind Ġget () Ġ= Ġwhen Ġ( parsed Model ) Ġ{ ĊĠĠĠ Ġis ĠFile Dependency Model Ġ-> ĠP s Jar Dependency . Kind . FILE ĊĠĠĠ Ġis ĠFile Tree Dependency Model Ġ-> ĠP s Jar Dependency . Kind . FILE _ TREE ĊĠĠĠ Ġelse Ġ-> Ġerror (" Unsupported Ġdependency Ġmodel : Ġ${ parsed Model . java Class . name }") ĊĠ Ġ} ĊĠ Ġoverride Ġval ĠfilePath : ĠString Ġget () Ġ= ĊĠĠĠ Ġ( parsed Model Ġas ? ĠFile Dependency Model )?. file ()?. asString () ĊĠĠĠ Ġ?: Ġ( parsed Model Ġas ? ĠFile Tree Dependency Model )?. dir ()?. asString () ĊĠĠĠ Ġ?: Ġ"" ĊĊĠ Ġprivate Ġinline Ġfun ĠgetFile Tree String List Property ( property Getter : ĠFile Tree Dependency Model . () Ġ-> ĠResolved Property Model ?) Ġ= ĊĠĠĠ Ġ( parsed Model Ġas ? ĠFile Tree Dependency Model )?. property Getter ()?. toList ()?. map Ġ{ Ġit . resolve (). asString (). or Empty () Ġ}. or Empty () ĊĊĠ Ġoverride Ġval Ġincludes : ĠList < String > Ġget () Ġ= ĠgetFile Tree String List Property Ġ{ Ġincludes () Ġ} ĊĠ Ġoverride Ġval Ġexclude s : ĠList < String > Ġget () Ġ= ĠgetFile Tree String List Property Ġ{ Ġexclude s () Ġ} ĊĊĠ Ġoverride Ġval Ġis Declared : ĠBoolean Ġ= Ġtrue ĊĠ Ġoverride Ġval Ġconfiguration Name : ĠString Ġget () Ġ= Ġparsed Model . configuration Name () ĊĠ Ġoverride Ġval Ġjoined Configuration Names : ĠString Ġget () Ġ= Ġconfiguration Name ĊĊĠ Ġobject ĠDescriptor Ġ: ĠModel Descriptor < Ps Declared Jar Android Dependency , ĠNothing , ĠDependency Model > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġget Resolved ( model : ĠP s Declared Jar Android Dependency ): ĠNothing ? Ġ= Ġnull ĊĠĠĠ Ġoverride Ġfun Ġget Parsed ( model : ĠP s Declared Jar Android Dependency ): ĠDependency Model ? Ġ= Ġmodel . parsed Model ĊĠĠĠ Ġoverride Ġfun Ġprepare For Modification ( model : ĠP s Declared Jar Android Dependency ) Ġ= ĠUnit ĊĊĠĠĠ Ġoverride Ġfun Ġset Modified ( model : ĠP s Declared Jar Android Dependency ) Ġ{ ĊĠĠĠĠĠ ĠTODO (" NOTE : ĠThere Ġis Ġno Ġneed Ġto Ġre - index Ġthe Ġdeclared Ġdependency Ġcollection . ĠVersion Ġis Ġnot Ġa Ġpart Ġof Ġthe Ġkey .") ĊĠĠĠĠĠ Ġmodel . is Modified Ġ= Ġtrue ĊĠĠĠĠĠ Ġ// ĠTODO ( solo dk yy ): ĠMake Ġset Modified () Ġcustom izable Ġat Ġthe Ġproperty Ġlevel Ġsince Ġsome Ġproperties Ġwill Ġneed Ġto Ġcall Ġreset Dependencies (). ĊĠĠĠĠĠ Ġmodel . parent . reset Resolved Dependencies () ĊĠĠĠĠĠ Ġmodel . parent . fire Dependency Modified Event ( lazy Ġ{ ĊĠĠĠĠĠĠĠ Ġmodel . parent . dependencies . find Jar Dependencies ( model . filePath ). first OrNull Ġ{ Ġit . configuration Name Ġ== Ġmodel . configuration Name Ġ} ĊĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġval Ġproperties : ĠCollection < Model Property < Ps Declared Jar Android Dependency , Ġ*, Ġ*, Ġ* >> Ġ= ĠlistOf () ĊĠ Ġ} Ċ } Ċ Ċ class ĠP s Resolved Jar Android Dependency ( ĊĠ Ġparent : ĠP s Android Module , ĊĠ Ġval Ġcollection : ĠP s Android Artifact Dependency Collection , ĊĠ Ġoverride Ġval ĠfilePath : ĠString , ĊĠ Ġval Ġartifact : ĠP s Android Artifact , ĊĠ Ġoverride Ġval Ġdeclared Dependencies : ĠList < Ps Declared Jar Android Dependency > Ċ ): ĠP s Jar Android Dependency ( parent ), ĠP s Resolved Jar Dependency Ġ{ ĊĠ Ġoverride Ġval Ġis Declared : ĠBoolean Ġget () Ġ= Ġ! declared Dependencies . isEmpty () Ċ } Ċ Ċ abstract Ġclass ĠP s Jar Android Dependency Ġinternal Ġconstructor ( ĊĠ Ġparent : ĠP s Android Module Ċ ) Ġ: ĠP s Android Dependency ( parent ), ĠP s Jar Dependency Ġ{ ĊĊĠ Ġoverride Ġval Ġname : ĠString Ġget () Ġ= ĠfilePath ĊĊĠ Ġoverride Ġfun Ġto Text (): ĠString Ġ= ĠfilePath ĊĊĠ Ġoverride Ġfun ĠtoString (): ĠString Ġ= Ġto Text () Ċ Ċ } Ċ