package Ġcom . so y wiz . k orge . intellij Ċ Ċ import Ġcom . intellij . execution . Before Run Task Ċ import Ġcom . intellij . execution . Before Run Task Provider Ċ import Ġcom . intellij . execution . Common Java Run Configuration Parameters Ċ import Ġcom . intellij . execution . configurations . Run Configuration Ċ import Ġcom . intellij . execution . runners . Execution Environment Ċ import Ġcom . intellij . openapi . action System . DataContext Ċ import Ġcom . intellij . openapi . project . Project Ċ import Ġcom . intellij . openapi . roots . Library Order Entry Ċ import Ġcom . intellij . openapi . util . Key Ċ import Ġorg . j dom . Element Ċ Ċ open Ġclass ĠK orge Update Resource Before Run Provider Ġ: ĠBefore Run Task Provider < Update Resource Before Run Task >() Ġ{ Ċ ĉ override Ġfun ĠgetDescription ( p 0 : ĠUpdate Resource Before Run Task ?): ĠString Ġ= Ġ" K orge Update Resource Before Run Provider " ĊĊ ĉ override Ġfun ĠgetName (): ĠString Ġ= Ġ" K orge Update Resource Before Run Provider " ĊĊ ĉ override Ġfun Ġcreate Task ( run Configuration : ĠRun Configuration ) Ġ= Ġwhen Ġ( run Configuration ) Ġ{ Ċĉ ĉ is ĠCommon Java Run Configuration Parameters Ġ-> ĠUpdate Resource Before Run Task ( run Configuration ) Ċĉ ĉ else Ġ-> Ġnull Ċ ĉ } ĊĊ ĉ override Ġfun ĠgetId (): ĠKey < Update Resource Before Run Task > Ġ= ĠUpdate Resource Before Run Task . KEY ĊĊ ĉ override Ġfun Ġexecute Task ( Ċĉ ĉ p 0 : ĠData Context ?, Ċĉ ĉ run Configuration : ĠRun Configuration , Ċĉ ĉ execution Environment : ĠExecution Environment , Ċĉ ĉ p 3 : ĠUpdate Resource Before Run Task ? Ċ ĉ ): ĠBoolean Ġ{ Ċĉ ĉ val Ġproject Ġ= Ġexecution Environment . project Ċĉ ĉ if Ġ( project . has K orge ()) Ġ{ Ċĉĉ ĉ println (" K OR GE Ġdetected Ġin Ġ$ project ") Ċĉĉ ĉ K orge Build Resources Action . build ( project ) Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ println (" K OR GE ĠNOT Ġdetected Ġin Ġ$ project ") Ċĉ ĉ } Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ override Ġfun Ġis Configurable (): ĠBoolean Ġ{ Ċĉ ĉ return Ġfalse Ċ ĉ } ĊĊ ĉ override Ġfun Ġcan Execute Task ( p 0 : ĠRun Configuration ?, Ġp 1 : ĠUpdate Resource Before Run Task ?): ĠBoolean Ġ{ Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ override Ġfun Ġconfigure Task ( p 0 : ĠRun Configuration ?, Ġp 1 : ĠUpdate Resource Before Run Task ?): ĠBoolean Ġ{ Ċĉ ĉ return Ġtrue Ċ ĉ } Ċ } Ċ Ċ data Ġclass ĠUpdate Resource Before Run Task ( val Ġrun Configuration : ĠCommon Java Run Configuration Parameters ) Ġ: Ċ ĉ Before Run Task < Update Resource Before Run Task >( KEY ) Ġ{ Ċ ĉ comp anion Ġobject Ġ{ Ċĉ ĉ val ĠKEY Ġ= ĠKey < Update Resource Before Run Task >( Update Resource Before Run Task :: class . java . name ) Ċ ĉ } ĊĊ ĉ // override Ġfun Ġwrite External ( element : ĠElement ?) Ġ= ĠUnit Ċ ĉ // override Ġfun Ġread External ( element : ĠElement ?) Ġ= ĠUnit Ċ ĉ // override Ġfun Ġset Enabled ( isEnabled : ĠBoolean ) Ġ= ĠUnit Ċ ĉ // override Ġfun Ġget Items Count (): ĠInt Ġ= Ġ 0 Ċ ĉ override Ġfun Ġclone (): ĠBefore Run Task < out ĠBefore Run Task <* >> Ġ= Ġthis . copy () ĊĊ ĉ // override Ġfun Ġis Enabled (): ĠBoolean Ġ= Ġrun Configuration . project . has K orge () Ċ ĉ override Ġfun Ġis Enabled (): ĠBoolean Ġ= Ġtrue Ċ } Ċ Ċ private Ġfun ĠProject . has K orge (): ĠBoolean Ġ{ Ċ ĉ val Ġproject Ġ= Ġthis Ċ ĉ for Ġ( module Ġin Ġproject . module Manager . modules ) Ġ{ Ċĉ ĉ for Ġ( order Entry Ġin Ġmodule . root Manager . order Entries ) Ġ{ Ċĉĉ ĉ if Ġ( order Entry Ġis ĠLibrary Order Entry ) Ġ{ Ċĉĉĉ ĉ val Ġlibrary Name Ġ= Ġorder Entry . library Name Ġ?: Ġ"" Ċĉĉĉ ĉ if Ġ( library Name . contains (" k orge - core ")) Ġreturn Ġtrue Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } Ċ ĉ return Ġfalse Ċ } Ċ