/** Ċ Ġ* ĠThe ĠMIT ĠLicense Ġ( MIT ) Ċ Ġ* Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 1 7 ĠS pen cer ĠPark Ċ Ġ* Ċ Ġ* ĠPermission Ġis Ġhereby Ġgranted , Ġfree Ġof Ġcharge , Ġto Ġany Ġperson Ġobtaining Ġa Ġcopy Ċ Ġ* Ġof Ġthis Ġsoftware Ġand Ġassociated Ġdocumentation Ġfiles Ġ( the Ġ" Software "), Ġto Ġdeal Ċ Ġ* Ġin Ġthe ĠSoftware Ġwithout Ġrestriction , Ġincluding Ġwithout Ġlimitation Ġthe Ġrights Ċ Ġ* Ġto Ġuse , Ġcopy , Ġmodify , Ġmerge , Ġpublish , Ġdistribute , Ġsublicense , Ġand / or Ġsell Ċ Ġ* Ġcopies Ġof Ġthe ĠSoftware , Ġand Ġto Ġpermit Ġpersons Ġto Ġwhom Ġthe ĠSoftware Ġis Ċ Ġ* Ġfurnished Ġto Ġdo Ġso , Ġsubject Ġto Ġthe Ġfollowing Ġconditions : Ċ Ġ* Ċ Ġ* ĠThe Ġabove Ġcopyright Ġnotice Ġand Ġthis Ġpermission Ġnotice Ġshall Ġbe Ġincluded Ġin Ġall Ċ Ġ* Ġcopies Ġor Ġsubstantial Ġportions Ġof Ġthe ĠSoftware . Ċ Ġ* Ċ Ġ* ĠTHE ĠSOFTWARE ĠIS ĠPROVIDED Ġ" AS ĠIS ", ĠWITHOUT ĠWARRANTY ĠOF ĠANY ĠKIND , ĠEXPRESS ĠOR Ċ Ġ* ĠIMPLIED , ĠINCLUDING ĠBUT ĠNOT ĠLIMITED ĠTO ĠTHE ĠWARRANTIES ĠOF ĠMERCHANTABILITY , Ċ Ġ* ĠFITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE ĠAND ĠNONINFRINGEMENT . ĠIN ĠNO ĠEVENT ĠSHALL ĠTHE Ċ Ġ* ĠAUTHORS ĠOR ĠCOPYRIGHT ĠHOLDERS ĠBE ĠLIABLE ĠFOR ĠANY ĠCLAIM , ĠDAMAGES ĠOR ĠOTHER Ċ Ġ* ĠLIABILITY , ĠWHETHER ĠIN ĠAN ĠACTION ĠOF ĠCONTRACT , ĠTORT ĠOR ĠOTHERWISE , ĠARISING ĠFROM , Ċ Ġ* ĠOUT ĠOF ĠOR ĠIN ĠCONNECTION ĠWITH ĠTHE ĠSOFTWARE ĠOR ĠTHE ĠUSE ĠOR ĠOTHER ĠDEALINGS ĠIN ĠTHE Ċ Ġ* ĠSOFTWARE . Ċ Ġ*/ Ċ package Ġio . github . sp encer park . jupyter . gradle Ċ Ċ import Ġgro ovy . lang . Closure Ċ import Ġgro ovy . lang . Deleg ates To Ċ import Ġorg . gradle . api . Action Ċ import Ġorg . gradle . api . Project Ċ import Ġorg . gradle . api . file . Configurable File Collection Ċ import Ġorg . gradle . api . file . Copy Source Spec Ċ import Ġorg . gradle . api . file . File Collection Ċ import Ġorg . gradle . api . file . Regular File Ċ import Ġorg . gradle . api . file . Regular File Property Ċ import Ġorg . gradle . api . internal . file . copy . Copy Spec Internal Ċ import Ġorg . gradle . api . model . ObjectFactory Ċ import Ġorg . gradle . api . provider . Map Property Ċ import Ġorg . gradle . api . provider . Property Ċ import Ġorg . gradle . util . Configure Util Ċ import Ġjavax . inject . Inject Ċ Ċ open Ġclass ĠKernel Extension Ġ@ Inject Ġconstructor ( private Ġval Ġproject : ĠProject , Ġobjects : ĠObject Factory ) Ġ: ĠWith Gradle Dsl Extensions Ġ{ ĊĠĠĠ Ġval Ġkernel Name : ĠProperty < String > Ġ= Ġobjects . property ( String :: class . java ). convention ( project . name ) ĊĠĠĠ Ġval Ġkernel DisplayName : ĠProperty < String > Ġ= Ġobjects . property ( String :: class . java ). convention ( kernel Name ) ĊĠĠĠ Ġval Ġkernel Language : ĠProperty < String > Ġ= Ġobjects . property ( String :: class . java ). convention ( kernel Name ) ĊĊĠĠĠ Ġval Ġkernel Interrupt Mode : ĠProperty < String > Ġ= Ġobjects . property ( String :: class . java ). convention (" message ") ĊĊĠĠĠ Ġval Ġkernel Env : ĠMap Property < String , ĠString > Ġ= Ġobjects . map Property ( String :: class . java , ĠString :: class . java ). convention ( mutable Map Of ()) ĊĊĠĠĠ Ġval Ġkernel Executable : ĠRegular File Property Ġ= Ġobjects . file Property () ĊĊĠĠĠ Ġval Ġkernel Resources : ĠConfigur able File Collection Ġ= Ġproject . files ( project . file Tree (" kernel ")) ĊĊĠĠĠ Ġval Ġkernel Parameters : ĠKernel Parameter Spec Container Ġ= ĠKernel Parameter Spec Container ( objects ) ĊĊĠĠĠ Ġfun Ġkernel Name ( kernel Name : ĠString ?) Ġ= Ġthis . kernel Name . set ( kernel Name ) ĊĠĠĠ Ġfun Ġkernel DisplayName ( kernel DisplayName : ĠString ?) Ġ= Ġthis . kernel DisplayName . set ( kernel DisplayName ) ĊĠĠĠ Ġfun Ġkernel Language ( kernel Language : ĠString ?) Ġ= Ġthis . kernel Language . set ( kernel Language ) ĊĊĠĠĠ Ġfun Ġkernel Interrupt Mode ( kernel Interrupt Mode : ĠString ?) Ġ= Ġthis . kernel Interrupt Mode . set ( kernel Interrupt Mode ) ĊĊĠĠĠ Ġfun Ġkernel Env ( kernel Env : ĠMap < String , ĠString >) Ġ= Ġthis . kernel Env . put All ( kernel Env ) ĊĠĠĠ Ġfun Ġkernel Env ( configure : ĠAction < in ĠMutable Map < String , ĠString >>) Ġ= Ġthis . kernel Env . set ( this . kernel Env . get (). also ( configure :: execute )) ĊĊĠĠĠ Ġfun Ġkernel Executable ( kernel Executable : ĠRegular File ) Ġ= Ġthis . kernel Executable . set ( kernel Executable ) ĊĠĠĠ Ġfun Ġkernel Executable ( kernel Executable : ĠAny ) Ġ= Ġthis . kernel Executable . set ( project . file ( kernel Executable )) ĊĠĠĠ Ġfun Ġset Kernel Executable ( kernel Executable : ĠRegular File ) Ġ= Ġthis . kernel Executable . set ( kernel Executable ) ĊĊĠĠĠ Ġfun Ġkernel Resources ( configure : ĠAction < in ĠCopy Source Spec >) Ġ= Ġthis . kernel Resources . set From (( project . copy Spec ( configure ) Ġas ĠCopy Spec Internal ). build Root Resolver (). all Source ) ĊĠĠĠ Ġfun Ġkernel Resources (@ Deleg ates To ( value Ġ= ĠCopy Source Spec :: class , Ġstrategy Ġ= ĠClosure . DE LEG ATE _ FIRST ) Ġconfigure Closure : ĠClosure <* >) Ġ{ ĊĠĠĠĠĠĠĠ Ġthis . kernel Resources . set From (( project . copy Spec ( configure Closure ) Ġas ĠCopy Spec Internal ). build Root Resolver (). all Source ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġfun Ġset Kernel Resources ( kernel Resources : ĠFile Collection ) Ġ= Ġthis . kernel Resources . set From ( kernel Resources ) ĊĊĠĠĠ Ġfun Ġkernel Parameters ( configure : ĠAction < in ĠKernel Parameter Spec Container >) Ġ= Ġconfigure . execute ( this . kernel Parameters ) ĊĠĠĠ Ġfun Ġkernel Parameters (@ Deleg ates To ( value Ġ= ĠKernel Parameter Spec Container :: class , Ġstrategy Ġ= ĠClosure . DE LEG ATE _ FIRST ) Ġconfigure Closure : ĠClosure <* >) Ġ{ ĊĠĠĠĠĠĠĠ ĠConfigure Util . configure ( configure Closure , Ġthis . kernel Parameters ) ĊĠĠĠ Ġ} Ċ }