package Ġcom . mal in sk iy . mar athon Ċ Ċ import Ġcom . android . build . gradle . api . Base Variant Ċ import Ġcom . android . build . gradle . api . Test Variant Ċ import Ġcom . mal in sk iy . mar athon . android . Android Component Info Ċ import Ġcom . mal in sk iy . mar athon . android . Android Configuration Ċ import Ġcom . mal in sk iy . mar athon . android . DEFAULT _ APPLICATION _ PM _ CLEAR Ċ import Ġcom . mal in sk iy . mar athon . android . DEFAULT _ AUTO _ GRANT _ PERMISSION Ċ import Ġcom . mal in sk iy . mar athon . android . DEFAULT _ INSTALL _ OPTIONS Ċ import Ġcom . mal in sk iy . mar athon . android . default Init Timeout Millis Ċ import Ġcom . mal in sk iy . mar athon . android . serial . Serial Strategy Ċ import Ġcom . mal in sk iy . mar athon . execution . Configuration Ċ import Ġcom . mal in sk iy . mar athon . extensions . extract Application Ċ import Ġcom . mal in sk iy . mar athon . extensions . extract Test Application Ċ import Ġd dm lib Module Ċ import Ġorg . gradle . api . Project Ċ import Ġjava . io . File Ċ Ċ internal Ġfun Ġcreate Common Configuration ( ĊĠĠĠ Ġproject : ĠProject , ĊĠĠĠ Ġmar athon Extension Name : ĠString , ĊĠĠĠ Ġsdk Directory : ĠFile Ċ ): ĠConfiguration Ġ{ ĊĠĠĠ Ġval Ġtarget Project Ġ= Ġproject . root Project ĊĠĠĠ Ġval Ġextension Config Ġ= Ġtarget Project . extensions . get ByName ( mar athon Extension Name ) Ġas ? ĠMar athon Extension Ġ?: ĠMar athon Extension ( project ) ĊĊĠĠĠ Ġval Ġoutput Ġ= Ġget Output Directory ( target Project , Ġextension Config , Ġnull ) ĊĠĠĠ Ġval Ġfake A pk Ġ= ĠFile (".") ĊĠĠĠ Ġval Ġfake Name Ġ= Ġ" mar athon - common " ĊĊĠĠĠ Ġreturn Ġcreate Configuration ( ĊĠĠĠĠĠĠĠ Ġextension Config Ġ= Ġextension Config , ĊĠĠĠĠĠĠĠ Ġapplication A pk Ġ= Ġnull , ĊĠĠĠĠĠĠĠ Ġinstrument ation A pk Ġ= Ġfake A pk , ĊĠĠĠĠĠĠĠ Ġsdk Directory Ġ= Ġsdk Directory , ĊĠĠĠĠĠĠĠ Ġname Ġ= Ġfake Name , ĊĠĠĠĠĠĠĠ Ġoutput Ġ= Ġoutput ĊĠĠĠ Ġ) Ċ } Ċ Ċ internal Ġfun Ġcreate Component Info ( ĊĠĠĠ Ġproject : ĠProject , ĊĠĠĠ Ġflavor Name : ĠString , ĊĠĠĠ Ġapplication Variant : ĠBase Variant , ĊĠĠĠ Ġtest Variant : ĠTest Variant Ċ ): ĠAndroid Component Info Ġ{ ĊĠĠĠ Ġval Ġname Ġ= Ġcreate Component Name ( project , Ġflavor Name ) ĊĠĠĠ Ġval Ġinstrument ation A pk Ġ= Ġtest Variant . extract Test Application () ĊĠĠĠ Ġval Ġapplication A pk Ġ= Ġapplication Variant . extract Application () ĊĊĠĠĠ Ġreturn ĠAndroid Component Info ( name Ġ= Ġname , Ġapplication Output Ġ= Ġapplication A pk , Ġtest Application Output Ġ= Ġinstrument ation A pk ) Ċ } Ċ Ċ internal Ġfun Ġcreate Configuration ( ĊĠĠĠ Ġproject : ĠProject , ĊĠĠĠ Ġmar athon Extension Name : ĠString , ĊĠĠĠ Ġsdk Directory : ĠFile , ĊĠĠĠ Ġflavor Name : ĠString , ĊĠĠĠ Ġapplication Variant : ĠBase Variant , ĊĠĠĠ Ġtest Variant : ĠTest Variant Ċ ): ĠConfiguration Ġ{ ĊĠĠĠ Ġval Ġextension Config Ġ= Ġproject . extensions . get ByName ( mar athon Extension Name ) Ġas ? ĠMar athon Extension Ġ?: ĠMar athon Extension ( project ) ĊĠĠĠ Ġval Ġinstrument ation A pk Ġ= Ġtest Variant . extract Test Application () ĊĠĠĠ Ġval Ġapplication A pk Ġ= Ġapplication Variant . extract Application () ĊĊĠĠĠ Ġreturn Ġcreate Configuration ( ĊĠĠĠĠĠĠĠ Ġextension Config Ġ= Ġextension Config , ĊĠĠĠĠĠĠĠ Ġapplication A pk Ġ= Ġapplication A pk , ĊĠĠĠĠĠĠĠ Ġinstrument ation A pk Ġ= Ġinstrument ation A pk , ĊĠĠĠĠĠĠĠ Ġsdk Directory Ġ= Ġsdk Directory , ĊĠĠĠĠĠĠĠ Ġname Ġ= Ġcreate Component Name ( project , Ġflavor Name ), ĊĠĠĠĠĠĠĠ Ġoutput Ġ= Ġget Output Directory ( project , Ġextension Config , Ġflavor Name ) ĊĠĠĠ Ġ) Ċ } Ċ Ċ private Ġfun Ġcreate Component Name ( project : ĠProject , Ġflavor Name : ĠString ): ĠString Ġ= ĊĠĠĠ Ġproject . path Ġ+ Ġ":" Ġ+ Ġflavor Name Ċ Ċ private Ġfun Ġcreate Configuration ( ĊĠĠĠ Ġextension Config : ĠMar athon Extension , ĊĠĠĠ Ġapplication A pk : ĠFile ?, ĊĠĠĠ Ġinstrument ation A pk : ĠFile , ĊĠĠĠ Ġsdk Directory : ĠFile , ĊĠĠĠ Ġname : ĠString , ĊĠĠĠ Ġoutput : ĠFile Ċ ): ĠConfiguration Ġ= ĠConfiguration ( ĊĠĠĠ Ġname Ġ= Ġname , ĊĠĠĠ Ġoutput Dir Ġ= Ġoutput , ĊĠĠĠ Ġanalytics Configuration Ġ= Ġextension Config . analytics Configuration ?. to Analytics Configuration (), ĊĠĠĠ Ġcustom Analytics Tracker Ġ= Ġextension Config . custom Analytics Tracker , ĊĠĠĠ Ġpooling Strategy Ġ= Ġextension Config . pool ing Strategy ?. to Strategy (), ĊĠĠĠ Ġsh arding Strategy Ġ= Ġextension Config . sharding Strategy ?. to Strategy (), ĊĠĠĠ Ġsorting Strategy Ġ= Ġextension Config . sorting Strategy ?. to Strategy (), ĊĠĠĠ Ġbatch ing Strategy Ġ= Ġextension Config . batch ing Strategy ?. to Strategy (), ĊĠĠĠ Ġfl ak iness Strategy Ġ= Ġextension Config . fl ak iness Strategy ?. to Strategy (), ĊĠĠĠ Ġretry Strategy Ġ= Ġextension Config . retry Strategy ?. to Strategy (), ĊĠĠĠ Ġfiltering Configuration Ġ= Ġextension Config . filtering Configuration ?. to Filtering Configuration (), ĊĠĠĠ Ġpull Screenshot Filter Configuration Ġ= Ġextension Config . pull Screenshot Filter Configuration ?. to Filtering Configuration (), ĊĠĠĠ Ġstrict Run Filter Configuration Ġ= Ġextension Config . strict Run Filter Configuration ?. to Strict Run Filter Configuration (), ĊĠĠĠ Ġcache Ġ= Ġextension Config . cache ?. to Cache Configuration (), ĊĠĠĠ Ġignore Failures Ġ= Ġextension Config . ignore Failures , ĊĠĠĠ Ġis Code Coverage Enabled Ġ= Ġextension Config . is Code Coverage Enabled , ĊĠĠĠ Ġfallback To Screenshots Ġ= Ġextension Config . fallback To Screenshots , ĊĠĠĠ Ġstrict Mode Ġ= Ġextension Config . strict Mode , ĊĠĠĠ Ġlistener Ġ= Ġextension Config . listener , ĊĠĠĠ Ġun completed Test Retry Quota Ġ= Ġextension Config . un completed Test Retry Quota , ĊĠĠĠ Ġtest Class Regex es Ġ= Ġextension Config . test Class Regex es ?. map Ġ{ Ġit . to Regex () Ġ}, ĊĠĠĠ Ġinclude Serial Regex es Ġ= Ġextension Config . include Serial Regex es ?. map Ġ{ Ġit . to Regex () Ġ}, ĊĠĠĠ Ġexclude Serial Regex es Ġ= Ġextension Config . exclude Serial Regex es ?. map Ġ{ Ġit . to Regex () Ġ}, ĊĠĠĠ Ġignore Failure Regex es Ġ= Ġextension Config . ignore Failure Regex es ?. map Ġ{ Ġit . to Regex ( Regex Option . DOT _ MATCH ES _ ALL ) Ġ}, ĊĠĠĠ Ġtest Batch Timeout Millis Ġ= Ġextension Config . test Batch Timeout Millis , ĊĠĠĠ Ġtest Output Timeout Millis Ġ= Ġextension Config . test Output Timeout Millis , ĊĠĠĠ Ġno Devices Timeout Millis Ġ= Ġextension Config . no Devices Timeout Millis , ĊĠĠĠ Ġdebug Ġ= Ġextension Config . debug , ĊĠĠĠ Ġvendor Configuration Ġ= Ġcreate Android Configuration ( extension Config , Ġapplication A pk , Ġinstrument ation A pk , Ġsdk Directory ), ĊĠĠĠ Ġanalytics Tracking Ġ= Ġextension Config . analytics Tracking Ċ ) Ċ Ċ private Ġfun Ġget Output Directory ( project : ĠProject , Ġextension Config : ĠMar athon Extension , Ġflavor Name : ĠString ?): ĠFile Ġ{ ĊĠĠĠ Ġval Ġbase Output Dir Ġ= Ġextension Config . base Output Dir ?. let Ġ{ ĊĠĠĠĠĠĠĠ ĠFile ( it ) ĊĠĠĠ Ġ} Ġ?: Ġproject . build Dir . resolve (" reports / mar athon ") ĊĊĠĠĠ Ġreturn Ġflavor Name ?. let Ġ{ Ġbase Output Dir . resolve ( it ) Ġ} Ġ?: Ġbase Output Dir Ċ } Ċ Ċ private Ġfun Ġcreate Android Configuration ( ĊĠĠĠ Ġextension : ĠMar athon Extension , ĊĠĠĠ Ġapplication A pk : ĠFile ?, ĊĠĠĠ Ġinstrument ation A pk : ĠFile , ĊĠĠĠ Ġsdk Directory : ĠFile Ċ ): ĠAndroid Configuration Ġ{ ĊĠĠĠ Ġval Ġauto Grant Permission Ġ= Ġextension . auto Grant Permission Ġ?: ĠDEFAULT _ AUTO _ GRANT _ PERMISSION ĊĠĠĠ Ġval Ġinstrument ation Args Ġ= Ġextension . instrumentation Args ĊĠĠĠ Ġval Ġapplication Pm Clear Ġ= Ġextension . application Pm Clear Ġ?: ĠDEFAULT _ APPLICATION _ PM _ CLEAR ĊĠĠĠ Ġval Ġtest Application Pm Clear Ġ= Ġextension . test Application Pm Clear Ġ?: ĠDEFAULT _ APPLICATION _ PM _ CLEAR ĊĠĠĠ Ġval Ġa db Init Timeout Ġ= Ġextension . adb Init Timeout Ġ?: Ġdefault Init Timeout Millis ĊĠĠĠ Ġval Ġinstall Options Ġ= Ġextension . install Options Ġ?: ĠDEFAULT _ INSTALL _ OPTIONS ĊĠĠĠ Ġval Ġprefer able Recorder Type Ġ= Ġextension . prefer able Recorder Type ĊĠĠĠ Ġval Ġserial Strategy Ġ= Ġextension . serial Strategy ĊĠĠĠĠĠĠĠ Ġ? . let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwhen Ġ( it ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSerial Strategy Configuration . AUT OM AT IC Ġ-> ĠSerial Strategy . AUT OM AT IC ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSerial Strategy Configuration . MAR ATH ON _ PROPERTY Ġ-> ĠSerial Strategy . MAR ATH ON _ PROPERTY ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSerial Strategy Configuration . BOOT _ PROPERTY Ġ-> ĠSerial Strategy . BOOT _ PROPERTY ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSerial Strategy Configuration . HOSTNAME Ġ-> ĠSerial Strategy . HOSTNAME ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSerial Strategy Configuration . DD MS Ġ-> ĠSerial Strategy . DD MS ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ?: ĠSerial Strategy . AUT OM AT IC ĊĊĠĠĠ Ġreturn ĠAndroid Configuration ( ĊĠĠĠĠĠĠĠ Ġsdk Directory , ĊĠĠĠĠĠĠĠ Ġapplication A pk , ĊĠĠĠĠĠĠĠ Ġinstrument ation A pk , ĊĠĠĠĠĠĠĠ ĠlistOf ( dd m lib Module ), ĊĠĠĠĠĠĠĠ Ġauto Grant Permission , ĊĠĠĠĠĠĠĠ Ġinstrument ation Args , ĊĠĠĠĠĠĠĠ Ġapplication Pm Clear , ĊĠĠĠĠĠĠĠ Ġtest Application Pm Clear , ĊĠĠĠĠĠĠĠ Ġa db Init Timeout , ĊĠĠĠĠĠĠĠ Ġinstall Options , ĊĠĠĠĠĠĠĠ Ġprefer able Recorder Type , ĊĠĠĠĠĠĠĠ Ġserial Strategy ĊĠĠĠ Ġ) Ċ } Ċ