/* Ċ Ġ* ĠCopyright Ġ 2 0 1 0 - 2 0 1 9 Ġ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 . Ċ Ġ*/ Ċ Ċ package Ġorg . jetbrains . kotlin . test Ċ Ċ import Ġcom . intellij . openapi . application . Path Manager . PROPERTY _ CONFIG _ PATH Ċ import Ġcom . intellij . openapi . application . Path Manager . PROPERTY _ SYSTEM _ PATH Ċ import Ġcom . intellij . openapi . util . io . File Util Ċ import Ġjava . io . File Ċ Ċ // ĠIt 's Ġimportant Ġthat Ġthis Ġis Ġnot Ġcreated Ġper Ġtest , Ġbut Ġrather Ġper Ġprocess . Ċ object ĠIde a System Properties For Parallel Run Configurator Ġ{ ĊĠĠĠ Ġprivate Ġval ĠGR AD LE _ WORK ER Ġ= ĠSystem . getProperty (" org . gradle . test . worker ") Ġ?: Ġ"" ĊĠĠĠ Ġ// TODO : Ġtry Ġto Ġremove Ġfolder Ġon Ġj vm Ġshutdown Ġ( there Ġare Ġsome Ġflash ing Ġtest Ġwith Ġdelete On Exit Ġ= Ġtrue ) ĊĠĠĠ Ġprivate Ġval ĠPROCESS _ TMP _ ROOT _ FOLDER Ġ= ĊĠĠĠĠĠĠĠ ĠFile Util . create Temp Directory ( File ( System . getProperty (" java . io . tmpdir ")), Ġ" test Root ", Ġ" GW $ GRAD LE _ WORK ER ", Ġfalse ). path ĊĠĠĠ Ġprivate Ġval ĠIDEA _ SYSTEM Ġ= ĠFile Util . create Temp Directory ( File ( PROCESS _ TMP _ ROOT _ FOLDER ), Ġ" idea - system ", Ġ"", Ġfalse ). path ĊĠĠĠ Ġprivate Ġval ĠIDEA _ CONFIG Ġ= ĠFile Util . create Temp Directory ( File ( PROCESS _ TMP _ ROOT _ FOLDER ), Ġ" idea - config ", Ġ"", Ġfalse ). path ĊĠĠĠ Ġprivate Ġval ĠAND ROID _ HOME Ġ= ĠFile Util . create Temp Directory ( File ( PROCESS _ TMP _ ROOT _ FOLDER ), Ġ". android ", Ġ"", Ġfalse ). path ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠUseful TestCase Ġtemp Ġdir Ġconstruction Ġcould Ġcause Ġfolder Ġcl ash Ġon Ġparallel Ġtest Ġexecution : ĊĠĠĠĠĠĠĠ Ġ// Ġ Ġmy TempDir Ġ= Ġnew ĠFile ( ORIGIN AL _ TEMP _ DIR , ĠTEMP _ DIR _ MARKER Ġ+ Ġtest Name ). getPath (); ĊĠĠĠĠĠĠĠ Ġ// ĠSo Ġwe Ġneed Ġto Ġsubstitute Ġ" java . io . tmpdir " Ġsystem Ġproperty Ġto Ġavoid Ġsuch Ġcl ashing Ġacross Ġdifferent Ġprocesses . ĊĠĠĠĠĠĠĠ Ġ// ĠIDEA ĠPR : Ġhttps :// github . com / Jet Brains / intellij - community / pull / 1 1 2 0 ĊĠĠĠĠĠĠĠ ĠSystem . setProperty (" java . io . tmpdir ", ĠPROCESS _ TMP _ ROOT _ FOLDER ) ĊĠĠĠĠĠĠĠ ĠSystem . setProperty ( PROPERTY _ SYSTEM _ PATH , ĠIDEA _ SYSTEM ) ĊĠĠĠĠĠĠĠ ĠSystem . setProperty ( PROPERTY _ CONFIG _ PATH , ĠIDEA _ CONFIG ) ĊĠĠĠĠĠĠĠ ĠSystem . setProperty (" ANDROID _ SDK _ HOME ", ĠAND ROID _ HOME ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Jvm Static ĊĠĠĠ Ġfun Ġset Properties () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// TODO : Ġmaybe Ġadd Ġcheck Ġfor Ġactual Ġfolders ĊĠĠĠ Ġ} Ċ }