@ file : Suppress (" Un stable Api Usage ") Ċ Ċ package Ġcom . aut onomous apps . services Ċ Ċ import Ġcom . aut onomous apps . FLAG _ MAX _ CACHE _ SIZE Ċ import Ġcom . aut onomous apps . model . Inline Member Capability Ċ import Ġcom . aut onomous apps . model . inter medi ates . Annotation Processor Dependency Ċ import Ġcom . aut onomous apps . model . inter medi ates . Explo ding Jar Ċ import Ġcom . github . ben man es . caffe ine . cache . Cache Ċ import Ġcom . github . ben man es . caffe ine . cache . C affe ine Ċ import Ġorg . gradle . api . Gradle Exception Ċ import Ġorg . gradle . api . invocation . Gradle Ċ import Ġorg . gradle . api . provider . Provider Ċ import Ġorg . gradle . api . services . Build Service Ċ import Ġorg . gradle . api . services . Build Service Parameters Ċ import Ġjava . util . concurrent . Concurrent Skip List Map Ċ Ċ abstract Ġclass ĠIn Memory Cache Ġ: ĠBuild Service < Build Service Parameters . None > Ġ{ ĊĠ Ġprivate Ġval Ġj ars : ĠMutable Map < String , ĠInt > Ġ= ĠConcurrent Skip List Map () ĊĠ Ġprivate Ġval Ġclasses : ĠMutable Map < String , ĠInt > Ġ= ĠConcurrent Skip List Map () ĊĊĠ Ġinternal Ġfun Ġupdate J ars ( jar Name : ĠString ) Ġ{ ĊĠĠĠ Ġj ars . merge ( jar Name , Ġ 1 ) Ġ{ ĠoldValue , Ġincrement Ġ-> ĠoldValue Ġ+ Ġincrement Ġ} ĊĠ Ġ} ĊĊĠ Ġinternal Ġfun Ġupdate Classes ( className : ĠString ) Ġ{ ĊĠĠĠ Ġclasses . merge ( className , Ġ 1 ) Ġ{ ĠoldValue , Ġincrement Ġ-> ĠoldValue Ġ+ Ġincrement Ġ} ĊĠ Ġ} ĊĊĠ Ġinternal Ġfun Ġclasses (): ĠMap < String , ĠInt > Ġ= Ġclasses ĊĊĠ Ġ/* ĊĠĠ Ġ* ĠCache s . ĊĠĠ Ġ*/ ĊĊĠ Ġprivate Ġinline Ġfun Ġ< re ified ĠK , Ġre ified ĠV > Ġnew Cache ( maxSize : ĠLong Ġ= ĠmaxSize ()): ĠCache < K , ĠV > Ġ{ ĊĠĠĠ Ġval Ġbuilder Ġ= ĠC affe ine . newBuilder () ĊĠĠĠ Ġif Ġ( maxSize Ġ>= Ġ 0 ) Ġbuilder . maximum Size ( maxSize ) ĊĠĠĠ Ġreturn Ġbuilder . build () ĊĠ Ġ} ĊĊĠ Ġ// ĠTODO Ġdocument Ġand / or Ġprovide ĠDSL ĊĠ Ġprivate Ġfun ĠmaxSize (): ĠLong Ġ{ ĊĠĠĠ Ġval Ġsys Prop Ġ= ĠSystem . getProperty ( FLAG _ MAX _ CACHE _ SIZE ) ĊĠĠĠ Ġreturn Ġtry Ġ{ ĊĠĠĠĠĠ Ġsys Prop ?. to Long () Ġ?: Ġ- 1 ĊĠĠĠ Ġ} Ġcatch Ġ( e : ĠException ) Ġ{ ĊĠĠĠĠĠ Ġthrow ĠGradle Exception ("$ sys Prop Ġis Ġnot Ġa Ġvalid Ġcache Ġsize . ĠProvide Ġa Ġlong Ġvalue ", Ġe ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġval Ġexplo ding J ars : ĠCache < String , ĠExplo ding Jar > Ġ= Ġnew Cache () ĊĠ Ġprivate Ġval Ġinline Members 2 : ĠCache < String , ĠSet < Inline Member Capability . Inline Member >> Ġ= Ġnew Cache () ĊĠ Ġprivate Ġval Ġpro cs 2 : ĠCache < String , ĠAnnotation Processor Dependency > Ġ= Ġnew Cache () ĊĊĠ Ġinternal Ġfun Ġexplo ded Jar ( name : ĠString ): ĠExplo ding Jar ? Ġ= Ġexplo ding J ars . as Map ()[ name ] ĊĠ Ġinternal Ġfun Ġexplo ded J ars ( name : ĠString , Ġexplo ding Jar : ĠExplo ding Jar ) Ġ{ ĊĠĠĠ Ġexplo ding J ars . as Map (). put If Absent ( name , Ġexplo ding Jar ) ĊĠ Ġ} ĊĊĠ Ġinternal Ġfun Ġinline Member 2 ( name : ĠString ): ĠSet < Inline Member Capability . Inline Member >? Ġ= Ġinline Members 2 . as Map ()[ name ] ĊĊĠ Ġinternal Ġfun Ġinline Members 2 ( name : ĠString , Ġmembers : ĠSet < Inline Member Capability . Inline Member >) Ġ{ ĊĠĠĠ Ġinline Members 2 . as Map (). put If Absent ( name , Ġmembers ) ĊĠ Ġ} ĊĊĠ Ġinternal Ġfun Ġproc 2 ( proc Name : ĠString ): ĠAnnotation Processor Dependency ? Ġ= Ġpro cs 2 . as Map ()[ proc Name ] ĊĠ Ġinternal Ġfun Ġpro cs 2 ( proc Name : ĠString , Ġproc : ĠAnnotation Processor Dependency ) Ġ{ ĊĠĠĠ Ġpro cs 2 . as Map (). put If Absent ( proc Name , Ġproc ) ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġprivate Ġconst Ġval ĠSHARE D _ SERVICES _ IN _ MEMORY _ CACHE Ġ= Ġ" in Memory Cache " ĊĊĠĠĠ Ġinternal Ġfun Ġregister ( gradle : ĠGradle ): ĠProvider < InMemory Cache > Ġ{ ĊĠĠĠĠĠ Ġreturn Ġgradle . shared Services . register If Absent ( SHARED _ SERVICES _ IN _ MEMORY _ CACHE , ĠIn Memory Cache :: class . java ) Ġ{} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ