/* Ċ Ġ* ĠCopyright Ġ 2 0 2 0 Ġthe Ġoriginal Ġauthor Ġor Ġauthors . Ċ Ġ* Ċ Ġ* Ġ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 Ġorg . gradle . instant execution . serialization . code cs . transform Ċ Ċ import Ġorg . gradle . api . file . File Collection Ċ import Ġorg . gradle . api . internal . artifacts . transform . Artifact Transform Dependencies Ċ import Ġorg . gradle . api . internal . artifacts . transform . Default Artifact Transform Dependencies Ċ import Ġorg . gradle . api . internal . artifacts . transform . Default Execution Graph Dependencies Resolver Ċ import Ġorg . gradle . api . internal . artifacts . transform . Execution Graph Dependencies Resolver Ċ import Ġorg . gradle . api . internal . artifacts . transform . Transformation Node Ċ import Ġorg . gradle . api . internal . artifacts . transform . Transformation Step Ċ import Ġorg . gradle . api . internal . artifacts . transform . Transformer Ċ import Ġorg . gradle . api . internal . tasks . Task Dependency Container Ċ import Ġorg . gradle . instant execution . serialization . Codec Ċ import Ġorg . gradle . instant execution . serialization . Read Context Ċ import Ġorg . gradle . instant execution . serialization . Write Context Ċ import Ġorg . gradle . instant execution . serialization . decode Pre serving Shared Identity Ċ import Ġorg . gradle . instant execution . serialization . encode Pre serving Shared Identity Of Ċ import Ġorg . gradle . internal . Try ĊĊ Ċ internal Ċ abstract Ġclass ĠAbstract Transformation Node Codec < T Ġ: ĠTransformation Node > Ġ: ĠCodec < T > Ġ{ ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun ĠWrite Context . encode ( value : ĠT ) Ġ{ ĊĠĠĠĠĠĠĠ Ġencode Pre serving Shared Identity Of ( value ) Ġ{ Ġdo Encode ( value ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġsuspend Ġfun ĠRead Context . decode (): ĠT Ġ= ĊĠĠĠĠĠĠĠ Ġdecode Pre serving Shared Identity Ġ{ Ġdo Decode () Ġ} ĊĊĠĠĠ Ġprotected ĊĠĠĠ Ġsuspend Ġfun ĠWrite Context . write Dependencies Resolver ( value : ĠTransformation Node ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtransformer Ġ= Ġvalue . transformation Step . transformer ĊĠĠĠĠĠĠĠ Ġif Ġ( transformer . requires Dependencies ()) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwrite Boolean ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwrite ( value . dependencies Resolver . selected Artifacts ( transformer )) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwrite Boolean ( false ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected ĊĠĠĠ Ġsuspend Ġfun ĠRead Context . read Dependencies Resolver (): ĠExecution Graph Dependencies Resolver Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequires Dependencies Ġ= Ġread Boolean () ĊĠĠĠĠĠĠĠ Ġval Ġdependencies Ġ= Ġif Ġ( requires Dependencies ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfiles Ġ= Ġread () Ġas ĠFile Collection ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDefault Artifact Transform Dependencies ( files ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠDefault Execution Graph Dependencies Resolver . MISSING _ DEPEND ENCI ES ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn ĠFixed Dependencies Resolver ( dependencies ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprotected ĊĠĠĠ Ġabstract Ġsuspend Ġfun ĠWrite Context . do Encode ( value : ĠT ) ĊĊĠĠĠ Ġprotected ĊĠĠĠ Ġabstract Ġsuspend Ġfun ĠRead Context . do Decode (): ĠT Ċ } ĊĊ Ċ class ĠFixed Dependencies Resolver ( private Ġval Ġdependencies : ĠArtifact Transform Dependencies ) Ġ: ĠExecution Graph Dependencies Resolver Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġcompute Dependency Nodes ( transformation Step : ĠTransformation Step ): ĠTask Dependency Container Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠIllegalStateException () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġselected Artifacts ( transformer : ĠTransformer ): ĠFile Collection Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġdependencies . files ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcompute Artifacts ( transformer : ĠTransformer ): ĠTry < Artifact Transform Dependencies > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠTry . successful ( dependencies ) ĊĠĠĠ Ġ} Ċ } Ċ