/* Ċ Ġ* ĠCopyright Ġ 2 0 1 0 - 2 0 2 2 ĠJetBrains Ġs . r . o . Ġand ĠKotlin ĠProgramming ĠLanguage Ġcontributors . Ċ Ġ* ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe Ġlicense / LICENSE . txt Ġfile . Ċ Ġ*/ Ċ Ċ @ file : Suppress (" FunctionName ") Ċ Ċ package Ġorg . jetbrains . kotlin . gradle . plugin . mpp . pm 2 0 Ċ Ċ import Ġorg . gradle . api . Project Ċ import Ġorg . gradle . api . artifacts . Configuration Ċ import Ġorg . gradle . api . artifacts . Configuration Public ations Ċ import Ġorg . gradle . api . capabilities . Capability Ċ import Ġorg . jetbrains . kotlin . gradle . plugin . mpp . pm 2 0 . Kotlin Gradle Fragment Configuration Capabilities . Capabilities Container Ċ Ċ /* ĠInternal Ġabbre viation Ġ*/ Ċ internal Ġtype alias ĠFragment Capabilities < T > Ġ= ĠKotlin Gradle Fragment Configuration Capabilities < T > Ċ Ċ interface ĠKotlin Gradle Fragment Configuration Capabilities < in ĠT Ġ: ĠKotlin Gradle Fragment > Ġ{ ĊĠĠĠ Ġinterface ĠCap abilities Container Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġcapability ( notation : ĠAny ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Capabilities ( container : ĠCap abilities Container , Ġfragment : ĠT ) ĊĊĠĠĠ Ġobject ĠNone Ġ: ĠKotlin Gradle Fragment Configuration Capabilities < Kotlin Gradle Fragment > Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġset Capabilities ( container : ĠCap abilities Container , Ġfragment : ĠKotlin Gradle Fragment ) Ġ= ĠUnit ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġ< T Ġ: ĠKotlin Gradle Fragment > ĠKotlin Gradle Fragment Configuration Capabilities < T >. set Capabilities ( ĊĠĠĠ Ġpublications : ĠConfiguration Public ations , Ġfragment : ĠT Ċ ) Ġ= Ġset Capabilities ( Capabilities Container ( publications ), Ġfragment ) Ċ Ċ fun ĠCap abilities Container ( configuration : ĠConfiguration Public ations ): ĠCap abilities Container Ġ= ĊĠĠĠ ĠCap abilities Container Impl ( configuration ) Ċ Ċ fun ĠCap abilities Container ( configuration : ĠConfiguration ): ĠCap abilities Container Ġ= ĊĠĠĠ ĠCap abilities Container Impl ( configuration . outgoing ) Ċ Ċ private Ġclass ĠCap abilities Container Impl ( ĊĠĠĠ Ġprivate Ġval Ġpublications : ĠConfiguration Public ations Ċ ) Ġ: ĠCap abilities Container Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġcapability ( notation : ĠAny ) Ġ= Ġpublications . capability ( notation ) Ċ } Ċ Ċ class ĠKotlin Gradle Fragment Configuration Capabilities Context < T Ġ: ĠKotlin Gradle Fragment > Ġinternal Ġconstructor ( ĊĠĠĠ Ġinternal Ġval Ġcontainer : ĠCap abilities Container , Ġval Ġfragment : ĠT Ċ ) Ġ: ĠCap abilities Container Ġby Ġcontainer Ġ{ ĊĠĠĠ Ġval Ġproject : ĠProject Ġget () Ġ= Ġfragment . project Ċ } Ċ Ċ fun Ġ< T Ġ: ĠKotlin Gradle Fragment > ĠFragment Capabilities ( ĊĠĠĠ Ġset Capabilities : ĠKotlin Gradle Fragment Configuration Capabilities Context < T >. () Ġ-> ĠUnit Ċ ): ĠKotlin Gradle Fragment Configuration Capabilities < T > Ġ= Ġobject Ġ: ĠKotlin Gradle Fragment Configuration Capabilities < T > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġset Capabilities ( container : ĠCap abilities Container , Ġfragment : ĠT ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠKotlin Gradle Fragment Configuration Capabilities Context ( container , Ġfragment ) ĊĠĠĠĠĠĠĠ Ġcontext . set Capabilities () ĊĠĠĠ Ġ} Ċ } Ċ Ċ operator Ġfun Ġ< T Ġ: ĠKotlin Gradle Fragment > ĠFragment Capabilities < T >. plus ( other : ĠFragment Capabilities < T >): ĠFragment Capabilities < T > Ġ{ ĊĠĠĠ Ġif Ġ( this Ġ=== ĠKotlin Gradle Fragment Configuration Capabilities . None ) Ġreturn Ġother ĊĠĠĠ Ġif Ġ( other Ġ=== ĠKotlin Gradle Fragment Configuration Capabilities . None ) Ġreturn Ġthis ĊĊĠĠĠ Ġif Ġ( this Ġis ĠComposite Fragment Capabilities Ġ&& Ġother Ġis ĠComposite Fragment Capabilities ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠComposite Fragment Capabilities ( this . children Ġ+ Ġother . children ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( this Ġis ĠComposite Fragment Capabilities ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠComposite Fragment Capabilities ( this . children Ġ+ Ġother ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( other Ġis ĠComposite Fragment Capabilities ) Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠComposite Fragment Capabilities ( listOf ( this ) Ġ+ Ġother . children ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn ĠComposite Fragment Capabilities ( listOf ( this , Ġother )) Ċ } Ċ Ċ internal Ġclass ĠComposite Fragment Capabilities < in ĠT Ġ: ĠKotlin Gradle Fragment >( val Ġchildren : ĠList < Fragment Capabilities < T >>) Ġ: ĊĠĠĠ ĠFragment Capabilities < T > Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġset Capabilities ( container : ĠCap abilities Container , Ġfragment : ĠT ) Ġ{ ĊĠĠĠĠĠĠĠ Ġchildren . forEach Ġ{ Ġchild Ġ-> Ġchild . set Capabilities ( container , Ġfragment ) Ġ} ĊĠĠĠ Ġ} Ċ } Ċ