/* Ċ Ġ* ĠCopyright Ġ 2 0 0 0 - 2 0 1 8 ĠJetBrains Ġs . r . o . Ġ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 (" unused ") Ċ Ċ package Ġkotlin . script . experimental . api Ċ Ċ import Ġkotlin . reflect . K Class Ċ import Ġkotlin . script . experimental . util . Properties Collection Ċ Ċ interface ĠScript Compilation Configuration Keys Ċ Ċ open Ġclass ĠScript Compilation Configuration ( base Configurations : ĠIterable < Script Compilation Configuration >, Ġbody : ĠBuilder . () Ġ-> ĠUnit ) Ġ: ĊĠĠĠ ĠProperties Collection ( Builder ( base Configurations ). apply ( body ). data ) Ġ{ ĊĊĠĠĠ Ġconstructor ( body : ĠBuilder . () Ġ-> ĠUnit Ġ= Ġ{}) Ġ: Ġthis ( emptyList (), Ġbody ) ĊĠĠĠ Ġconstructor ( ĊĠĠĠĠĠĠĠ Ġvar arg Ġbase Configurations : ĠScript Compilation Configuration , Ġbody : ĠBuilder . () Ġ-> ĠUnit Ġ= Ġ{} ĊĠĠĠ Ġ) Ġ: Ġthis ( base Configurations . as Iterable (), Ġbody ) ĊĊĠĠĠ Ġclass ĠBuilder Ġinternal Ġconstructor ( base Configurations : ĠIterable < Script Compilation Configuration >) Ġ: ĊĠĠĠĠĠĠĠ ĠScript Compilation Configuration Keys , ĊĠĠĠĠĠĠĠ ĠProperties Collection . Builder ( base Configurations ) ĊĊĠĠĠ Ġ// Ġinherited Ġfrom Ġscript Ġcompilation Configuration Ġfor Ġusing Ġas Ġa Ġkeys Ġanchor ĊĠĠĠ Ġcompanion Ġobject Ġ: ĠScript Compilation Configuration Keys ĊĊĠĠĠ Ġobject ĠDefault Ġ: ĠScript Compilation Configuration () Ċ } Ċ Ċ val ĠScript Compilation Configuration Keys . displayName Ġby ĠProperties Collection . key < String >(" Kotlin Ġscript ") Ġ// ĠName Ġof Ġthe Ġscript Ġtype Ċ Ċ val ĠScript Compilation Configuration Keys . file Extension Ġby ĠProperties Collection . key < String >(" k ts ") Ġ// Ġfile Ġextension Ċ Ċ val ĠScript Compilation Configuration Keys . base Class Ġby ĠProperties Collection . key < Kotlin Type >() Ġ// Ġscript Ġbase Ġclass Ċ Ċ val ĠScript Compilation Configuration Keys . script Body Target Ġby ĠProperties Collection . key < Script Body Target >( Script Body Target . Constructor ) Ċ Ċ val ĠScript Compilation Configuration Keys . implicit Re ceiv ers Ġby ĠProperties Collection . key < List < Kotlin Type >>() Ġ// Ġin Ġthe Ġorder Ġfrom Ġouter Ġto Ġinner Ġscope Ċ Ċ val ĠScript Compilation Configuration Keys . provided Properties Ġby ĠProperties Collection . key < Map < String , ĠKotlin Type >>() Ġ// Ġexternal Ġvariables Ċ Ċ val ĠScript Compilation Configuration Keys . default Imports Ġby ĠProperties Collection . key < List < String >>() Ċ Ċ val ĠScript Compilation Configuration Keys . dependencies Ġby ĠProperties Collection . key < List < Script Dependency >>() Ċ Ċ val ĠScript Compilation Configuration Keys . copy Annotations From Ġby ĠProperties Collection . key < List < Kotlin Type >>() Ċ Ċ val ĠScript Compilation Configuration Keys . compiler Options Ġby ĠProperties Collection . key < List < String >>() Ġ// ĠQ : ĠCommon Compiler Options Ġinstead ? Ċ Ċ val ĠScript Compilation Configuration Keys . ref ine Configuration Before Parsing Ġby ĠProperties Collection . key < Ref ine Configuration Before Parsing Data >() Ċ Ċ val ĠScript Compilation Configuration Keys . ref ine Configuration On Annotations Ġby ĠProperties Collection . key < Ref ine Configuration On Annotations Data >() Ċ Ċ val ĠScript Compilation Configuration Keys . ref ine Configuration On Sections Ġby ĠProperties Collection . key < Ref ine Configuration On Sections Data >() Ċ Ċ val ĠScript Compilation Configuration Keys . source Fragments Ġby ĠProperties Collection . key < List < Script Source Named Fragment >>() Ċ Ċ // ĠDSL : Ċ Ċ val ĠScript Compilation Configuration . Builder . ref ine Configuration Ġget () Ġ= ĠRef ine Configuration Builder () ĊĊ Ċ class ĠRef ine Configuration Builder Ġ: ĠProperties Collection . Builder () Ġ{ ĊĊĠĠĠ Ġfun Ġbefore Parsing ( handler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġset ( Script Compilation Configuration . ref ine Configuration Before Parsing , ĠRef ine Configuration Before Parsing Data ( handler )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Annotations ( annotations : ĠList < Kotlin Type >, Ġhandler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġset ( Script Compilation Configuration . ref ine Configuration On Annotations , ĠRef ine Configuration On Annotations Data ( annotations , Ġhandler )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Annotations ( var arg Ġannotations : ĠKotlin Type , Ġhandler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Annotations ( annotations . asList (), Ġhandler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinline Ġfun Ġ< re ified ĠT Ġ: ĠAnnotation > Ġon Annotations ( no inline Ġhandler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Annotations ( listOf ( Kotlin Type ( T :: class )), Ġhandler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Annotations ( var arg Ġannotations : ĠK Class < out ĠAnnotation >, Ġhandler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Annotations ( annotations . map Ġ{ ĠKotlin Type ( it ) Ġ}, Ġhandler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Annotations ( annotations : ĠIterable < K Class < out ĠAnnotation >>, Ġhandler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Annotations ( annotations . map Ġ{ ĠKotlin Type ( it ) Ġ}, Ġhandler ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Sections ( sections : ĠList < String >, Ġhandler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġset ( Script Compilation Configuration . ref ine Configuration On Sections , ĠRef ine Configuration On Sections Data ( sections , Ġhandler )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Sections ( var arg Ġsections : ĠString , Ġhandler : ĠRef ine Script Compilation Configuration Handler ) Ġ{ ĊĠĠĠĠĠĠĠ Ġon Sections ( sections . asList (), Ġhandler ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ type alias ĠRef ine Script Compilation Configuration Handler Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ( Script Configuration Ref inement Context ) Ġ-> ĠResult With Diagnostics < Script Compilation Configuration > Ċ Ċ // Ġto Ġmake Ġit Ġ" has he able " Ġfor Ġc ashing Ċ class ĠRef ine Configuration Before Parsing Data ( ĊĠĠĠ Ġval Ġhandler : ĠRef ine Script Compilation Configuration Handler Ċ ) Ċ Ċ class ĠRef ine Configuration On Annotations Data ( ĊĠĠĠ Ġval Ġannotations : ĠList < Kotlin Type >, ĊĠĠĠ Ġval Ġhandler : ĠRef ine Script Compilation Configuration Handler Ċ ) Ċ Ċ class ĠRef ine Configuration On Sections Data ( ĊĠĠĠ Ġval Ġsections : ĠList < String >, ĊĠĠĠ Ġval Ġhandler : ĠRef ine Script Compilation Configuration Handler Ċ ) ĊĊ Ċ interface ĠScript Compiler Ġ{ ĊĊĠĠĠ Ġsuspend Ġoperator Ġfun Ġinvoke ( ĊĠĠĠĠĠĠĠ Ġscript : ĠScript Source , ĊĠĠĠĠĠĠĠ Ġscript Compilation Configuration : ĠScript Compilation Configuration ĊĠĠĠ Ġ): ĠResult With Diagnostics < Compiled Script <* >> Ċ } ĊĊ Ċ interface ĠComp iled Script < out ĠScript Base Ġ: ĠAny > Ġ{ ĊĊĠĠĠ Ġval Ġcompilation Configuration : ĠScript Compilation Configuration ĊĊĠĠĠ Ġsuspend Ġfun Ġinstantiate ( script Evaluation Configuration : ĠScript Evaluation Configuration ?): ĠResult With Diagnostics < Script Base > Ċ } Ċ