@ file : Suppress (" Un stable Api Usage ") Ċ Ċ package Ġcom . aut onomous apps . internal . analyzer Ċ Ċ import Ġcom . aut onomous apps . internal . Output Paths Ċ import Ġcom . aut onomous apps . internal . utils . capitalize S af ely Ċ import Ġcom . aut onomous apps . internal . utils . named OrNull Ċ import Ġcom . aut onomous apps . model . Source Set Kind Ċ import Ġcom . aut onomous apps . services . InMemory Cache Ċ import Ġcom . aut onomous apps . should Analyze Tests Ċ import Ġcom . aut onomous apps . tasks .* Ċ import Ġorg . gradle . api . Project Ċ import Ġorg . gradle . api . Task Ċ import Ġorg . gradle . api . Unknown Domain Object Exception Ċ import Ġorg . gradle . api . artifacts . Configuration Ċ import Ġorg . gradle . api . file . File Tree Ċ import Ġorg . gradle . api . provider . Provider Ċ import Ġorg . gradle . api . tasks . Source Set Ċ import Ġorg . gradle . api . tasks . Task Provider Ċ import Ġorg . gradle . api . tasks . bund ling . Jar Ċ import Ġorg . gradle . kotlin . dsl . get Ċ import Ġorg . gradle . kotlin . dsl . register Ċ import Ġorg . jetbrains . kotlin . gradle . plugin . Kotlin Source Set Ġas ĠJ b Kotlin Source Set Ċ Ċ internal Ġabstract Ġclass ĠJ vm Analyzer ( ĊĠ Ġproject : ĠProject , ĊĠ Ġprivate Ġval Ġmain Source Set : ĠJ vm Source Set , ĊĠ Ġprivate Ġval Ġtest Source Set : ĠJ vm Source Set ? Ċ ) Ġ: ĠAbstract Dependency Analyzer ( project ) Ġ{ ĊĊĠ Ġfinal Ġoverride Ġval Ġflavor Name : ĠString ? Ġ= Ġnull ĊĠ Ġfinal Ġoverride Ġval Ġbuild Type : ĠString ? Ġ= Ġnull ĊĠ Ġfinal Ġoverride Ġval Ġkind : ĠSource Set Kind Ġ= Ġmain Source Set . kind ĊĠ Ġfinal Ġoverride Ġval Ġvariant Name : ĠString Ġ= Ġmain Source Set . name ĊĠ Ġfinal Ġoverride Ġval Ġvariant Name Capital ized : ĠString Ġ= Ġvariant Name . capitalize S af ely () ĊĠ Ġfinal Ġoverride Ġval Ġtask Name Suffix : ĠString Ġ= Ġvariant Name Capital ized ĊĊĠ Ġfinal Ġoverride Ġval Ġcompile Configuration Name Ġ= Ġmain Source Set . compile Classpath Configuration Name ĊĠ Ġfinal Ġoverride Ġval Ġtest Compile Configuration Name Ġ= Ġ" test Compile Classpath " ĊĠ Ġfinal Ġoverride Ġval Ġk apt Configuration Name Ġ= Ġ" k apt " ĊĠ Ġfinal Ġoverride Ġval Ġannotation Processor Configuration Name Ġ= Ġ" annotation Processor " ĊĊĠ Ġfinal Ġoverride Ġval Ġattribute Value Jar Ġ= Ġ" jar " ĊĊĠ Ġfinal Ġoverride Ġval Ġkotlin Source Files : ĠFile Tree Ġ= Ġget Kotlin Sources () ĊĠ Ġoverride Ġval Ġjava Source Files : ĠFile Tree ? Ġ= Ġget Java Sources () ĊĠ Ġfinal Ġoverride Ġval Ġjava And Kotlin Source Files : ĠFile Tree ? Ġ= Ġnull ĊĊĠ Ġfinal Ġoverride Ġval Ġis Data Binding Enabled : ĠBoolean Ġ= Ġfalse ĊĠ Ġfinal Ġoverride Ġval Ġis View Binding Enabled : ĠBoolean Ġ= Ġfalse ĊĊĠ Ġoverride Ġval Ġoutput Paths Ġ= ĠOutput Paths ( project , Ġvariant Name ) ĊĊĠ Ġoverride Ġfun Ġregister Create Variant Files Task (): ĠTask Provider < Jvm Create Variant Files > Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . register < Jvm Create Variant Files >(" create Variant Files $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġval Ġmain Files Ġ= Ġproject . files ( main Source Set . sourceCode . source Directories ) ĊĠĠĠĠĠ Ġval Ġtest Files Ġ= Ġtest Source Set ?. let Ġ{ Ġproject . files ( it . sourceCode . source Directories ) Ġ} ĊĊĠĠĠĠĠ Ġthis . main Files . set From ( main Files ) ĊĠĠĠĠĠ Ġtest Files ?. let Ġ{ Ġthis . test Files . set From ( it ) Ġ} ĊĊĠĠĠĠĠ Ġoutput . set ( output Paths . variant Files Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġfinal Ġoverride Ġval Ġtest Java Compile Name : ĠString Ġ= Ġ" compile Test Java " ĊĠ Ġfinal Ġoverride Ġval Ġtest Kotlin Compile Name : ĠString Ġ= Ġ" compile Test Kotlin " ĊĊĠ Ġfinal Ġoverride Ġfun Ġregister Class Analysis Task ( ĊĠĠĠ Ġcreate Variant Files : ĠTask Provider < out ĠCreate Variant Files > ĊĠ Ġ): ĠTask Provider < Class List Analysis Task > Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . register < Class List Analysis Task >(" analyze Class Usage $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġvariant Files . set ( create Variant Files . flatMap Ġ{ Ġit . output Ġ}) ĊĊĠĠĠĠĠ Ġjava Compile Task ()?. let Ġ{ Ġjava Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġkotlin Compile Task ()?. let Ġ{ Ġkotlin Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĊĠĠĠĠĠ Ġif Ġ( project . should Analyze Tests ()) Ġ{ ĊĠĠĠĠĠĠĠ Ġtest Java Compile ?. let Ġ{ Ġjava Compile Ġ-> ĊĠĠĠĠĠĠĠĠĠ Ġtest Java Classes Dir . set ( java Compile . flatMap Ġ{ Ġit . destination Directory Ġ}) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġtest Kotlin Compile ?. let Ġ{ Ġkotlin Compile Ġ-> ĊĠĠĠĠĠĠĠĠĠ Ġtest Kotlin Classes Dir . set ( kotlin Compile . flatMap Ġ{ Ġit . destination Directory Ġ}) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoutput . set ( output Paths . all Used Classes Path ) ĊĠĠĠĠĠ Ġoutput Pretty . set ( output Paths . all Used Classes Pretty Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġfinal Ġoverride Ġfun Ġregister Byte Code Source Explo der Task (): ĠTask Provider < Class List Explo der Task > Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . register < Class List Explo der Task >(" explode Byte Code Source $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġjava Compile Task ()?. let Ġ{ Ġjava Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġkotlin Compile Task ()?. let Ġ{ Ġkotlin Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġoutput . set ( output Paths . explo ding Byte code Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġfinal Ġoverride Ġfun Ġregister Find Declared Pro cs Task ( ĊĠĠĠ Ġin Memory Cache : ĠProvider < InMemory Cache >, ĊĠĠĠ Ġlocate Dependencies Task : ĠTask Provider < Loc ate Dependencies Task > ĊĠ Ġ): ĠTask Provider < Find Declared Pro cs Task > Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . register < Find Declared Pro cs Task >(" find Declared Pro cs $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġin Memory Cache Provider . set ( in Memory Cache ) ĊĠĠĠĠĠ Ġk apt Conf ()?. let Ġ{ ĊĠĠĠĠĠĠĠ Ġset K apt Artifacts ( it . incoming . artifacts ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġannotation Processor Conf ()?. let Ġ{ ĊĠĠĠĠĠĠĠ Ġset Annotation Processor Artifacts ( it . incoming . artifacts ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġlocations . set ( locate Dependencies Task . flatMap Ġ{ Ġit . output Ġ}) ĊĊĠĠĠĠĠ Ġoutput . set ( output Paths . declared Proc Path ) ĊĠĠĠĠĠ Ġoutput Pretty . set ( output Paths . declared Proc Pretty Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġfinal Ġoverride Ġfun Ġregister Find Declared Pro cs Task ( ĊĠĠĠ Ġin Memory Cache : ĠProvider < InMemory Cache > ĊĠ Ġ): ĠTask Provider < Find Declared Pro cs Task 2 > Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . register < Find Declared Pro cs Task 2 >(" find Declared Pro cs $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġin Memory Cache Provider . set ( in Memory Cache ) ĊĠĠĠĠĠ Ġk apt Conf ()?. let Ġ{ ĊĠĠĠĠĠĠĠ Ġset K apt Artifacts ( it . incoming . artifacts ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġannotation Processor Conf ()?. let Ġ{ ĊĠĠĠĠĠĠĠ Ġset Annotation Processor Artifacts ( it . incoming . artifacts ) ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoutput . set ( output Paths . declared Proc Path ) ĊĠĠĠĠĠ Ġoutput Pretty . set ( output Paths . declared Proc Pretty Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġfinal Ġoverride Ġfun Ġregister Find Unused Pro cs Task ( ĊĠĠĠ Ġfind Declared Pro cs : ĠTask Provider < Find Declared Pro cs Task >, ĊĠĠĠ Ġimport Finder : ĠTask Provider < Import Finder Task > ĊĠ Ġ): ĠTask Provider < Find Unused Pro cs Task > Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . register < Find Unused Pro cs Task >(" find Unused Pro cs ${ variant Name Capital ized }") Ġ{ ĊĠĠĠĠĠ Ġjava Compile Task ()?. let Ġ{ Ġjava Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġkotlin Compile Task ()?. let Ġ{ Ġkotlin Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġimports . set ( import Finder . flatMap Ġ{ Ġit . imports Report Ġ}) ĊĠĠĠĠĠ Ġannotation Processors Property . set ( find Declared Pro cs . flatMap Ġ{ Ġit . output Ġ}) ĊĊĠĠĠĠĠ Ġoutput . set ( output Paths . unused Proc Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġk apt Conf (): ĠConfiguration ? Ġ= Ġtry Ġ{ ĊĠĠĠ Ġproject . configurations [ k apt Configuration Name ] ĊĠ Ġ} Ġcatch Ġ(_ : ĠUnknown Domain Object Exception ) Ġ{ ĊĠĠĠ Ġnull ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġannotation Processor Conf (): ĠConfiguration ? Ġ= Ġtry Ġ{ ĊĠĠĠ Ġproject . configurations [ annotation Processor Configuration Name ] ĊĠ Ġ} Ġcatch Ġ(_ : ĠUnknown Domain Object Exception ) Ġ{ ĊĠĠĠ Ġnull ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġjava Compile Task (): ĠTask Provider < Task >? Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . named OrNull ( main Source Set . java Compile Task Name ) ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġkotlin Compile Task (): ĠTask Provider < Task >? Ġ{ ĊĠĠĠ Ġreturn Ġproject . tasks . named OrNull ( main Source Set . kotlin Compile Task Name ) ĊĠĠĠ Ġ// ĠTODO ĠV 2 : Ġmulti platform Ġand Ġtest Ġsupport ĊĠĠĠĠĠ Ġ?: Ġproject . tasks . named OrNull (" compile Kotlin Jvm ") Ġ// Ġfor Ġmulti platform Ġprojects ĊĠ Ġ} ĊĊĠ Ġprotected Ġfun Ġget Jar Task (): ĠTask Provider < Jar > Ġ= Ġproject . tasks . named ( main Source Set . jar Task Name , ĠJar :: class . java ) ĊĊĠ Ġprivate Ġfun Ġget Kotlin Sources (): ĠFile Tree Ġ= Ġget Source Directories (). matching Ġ{ ĊĠĠĠ Ġinclude (" ** /*. kt ") ĊĠĠĠ Ġexclude (" ** /*. java ") ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġget Java Sources (): ĠFile Tree Ġ= Ġget Source Directories (). matching Ġ{ ĊĠĠĠ Ġinclude (" ** /*. java ") ĊĠĠĠ Ġexclude (" ** /*. kt ") ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġget Source Directories (): ĠFile Tree Ġ{ ĊĠĠĠ Ġval Ġjava And Kotlin Source Ġ= Ġmain Source Set . sourceCode . source Directories ĊĠĠĠ Ġreturn Ġproject . files ( java And Kotlin Source ). as File Tree ĊĠ Ġ} Ċ } Ċ Ċ internal Ġclass ĠJava App Analyzer ( ĊĠ Ġproject : ĠProject , ĊĠ Ġsource Set : ĠSource Set , ĊĠ Ġtest Source Set : ĠSource Set ?, ĊĠ Ġkind : ĠSource Set Kind Ċ ) Ġ: ĠJ vm Analyzer ( ĊĠ Ġproject , ĊĠ ĠJava Source Set ( source Set , Ġkind ), ĊĠ Ġtest Source Set ?. let Ġ{ ĠJava Source Set ( it , ĠSource Set Kind . TEST ) Ġ} Ċ ) Ċ Ċ internal Ġclass ĠJava Lib Analyzer ( ĊĠ Ġproject : ĠProject , ĊĠ Ġsource Set : ĠSource Set , ĊĠ Ġtest Source Set : ĠSource Set ?, ĊĠ Ġkind : ĠSource Set Kind , ĊĠ Ġprivate Ġval Ġhas Ab i : ĠBoolean Ċ ) Ġ: ĠJ vm Analyzer ( ĊĠ Ġproject , ĊĠ ĠJava Source Set ( source Set , Ġkind ), ĊĠ Ġtest Source Set ?. let Ġ{ ĠJava Source Set ( it , ĠSource Set Kind . TEST ) Ġ} Ċ ) Ġ{ ĊĊĠ Ġoverride Ġfun Ġregister Ab i Analysis Task ( ĊĠĠĠ Ġanalyze Jar Task : ĠTask Provider < Analyze Jar Task >, ĊĠĠĠ Ġabi Ex clusions : ĠProvider < String > ĊĠ Ġ): ĠTask Provider < Ab i Analysis Task >? Ġ{ ĊĠĠĠ Ġif Ġ(! has Ab i ) Ġreturn Ġnull ĊĊĠĠĠ Ġreturn Ġproject . tasks . register < Ab i Analysis Task >(" abi Analysis $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġjava Compile Task ()?. let Ġ{ Ġjava Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġkotlin Compile Task ()?. let Ġ{ Ġkotlin Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġdependencies . set ( analyze Jar Task . flatMap Ġ{ Ġit . all Components Report Ġ}) ĊĠĠĠĠĠ Ġex clusions . set ( abi Ex clusions ) ĊĊĠĠĠĠĠ Ġoutput . set ( output Paths . abi Analysis Path ) ĊĠĠĠĠĠ Ġabi Dump . set ( output Paths . abi Dump Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġregister Ab i Analysis Task 2 ( abi Ex clusions : ĠProvider < String >): ĠTask Provider < Ab i Analysis Task 2 >? Ġ{ ĊĠĠĠ Ġif Ġ(! has Ab i ) Ġreturn Ġnull ĊĊĠĠĠ Ġreturn Ġproject . tasks . register < Ab i Analysis Task 2 >(" abi Analysis $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġjava Compile Task ()?. let Ġ{ Ġjava Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġkotlin Compile Task ()?. let Ġ{ Ġkotlin Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġex clusions . set ( abi Ex clusions ) ĊĠĠĠĠĠ Ġoutput . set ( output Paths . abi Analysis Path ) ĊĠĠĠĠĠ Ġabi Dump . set ( output Paths . abi Dump Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ Ċ internal Ġabstract Ġclass ĠKotlin Jvm Analyzer ( ĊĠ Ġproject : ĠProject , ĊĠ Ġmain Source Set : ĠJ b Kotlin Source Set , ĊĠ Ġtest Source Set : ĠJ b Kotlin Source Set ?, ĊĠ Ġkind : ĠSource Set Kind Ċ ) Ġ: ĠJ vm Analyzer ( ĊĠ Ġproject Ġ= Ġproject , ĊĠ Ġmain Source Set Ġ= ĠKotlin Source Set ( main Source Set , Ġkind ), ĊĠ Ġtest Source Set Ġ= Ġtest Source Set ?. let Ġ{ ĠKotlin Source Set ( it , ĠSource Set Kind . TEST ) Ġ} Ċ ) Ġ{ ĊĠ Ġfinal Ġoverride Ġval Ġjava Source Files : ĠFile Tree ? Ġ= Ġnull Ċ } Ċ Ċ internal Ġclass ĠKotlin Jvm App Analyzer ( ĊĠ Ġproject : ĠProject , ĊĠ Ġsource Set : ĠJ b Kotlin Source Set , ĊĠ Ġtest Source Set : ĠJ b Kotlin Source Set ?, ĊĠ Ġkind : ĠSource Set Kind Ċ ) Ġ: ĠKotlin Jvm Analyzer ( ĊĠ Ġproject Ġ= Ġproject , ĊĠ Ġmain Source Set Ġ= Ġsource Set , ĊĠ Ġtest Source Set Ġ= Ġtest Source Set , ĊĠ Ġkind Ġ= Ġkind Ċ ) Ċ Ċ internal Ġclass ĠKotlin Jvm Lib Analyzer ( ĊĠ Ġproject : ĠProject , ĊĠ Ġmain Source Set : ĠJ b Kotlin Source Set , ĊĠ Ġtest Source Set : ĠJ b Kotlin Source Set ?, ĊĠ Ġkind : ĠSource Set Kind , ĊĠ Ġprivate Ġval Ġhas Ab i : ĠBoolean Ċ ) Ġ: ĠKotlin Jvm Analyzer ( ĊĠ Ġproject Ġ= Ġproject , ĊĠ Ġmain Source Set Ġ= Ġmain Source Set , ĊĠ Ġtest Source Set Ġ= Ġtest Source Set , ĊĠ Ġkind Ġ= Ġkind Ċ ) Ġ{ ĊĊĠ Ġoverride Ġfun Ġregister Ab i Analysis Task ( ĊĠĠĠ Ġanalyze Jar Task : ĠTask Provider < Analyze Jar Task >, ĊĠĠĠ Ġabi Ex clusions : ĠProvider < String > ĊĠ Ġ): ĠTask Provider < Ab i Analysis Task >? Ġ{ ĊĠĠĠ Ġif Ġ(! has Ab i ) Ġreturn Ġnull ĊĊĠĠĠ Ġreturn Ġproject . tasks . register < Ab i Analysis Task >(" abi Analysis $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġjava Compile Task ()?. let Ġ{ Ġjava Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġkotlin Compile Task ()?. let Ġ{ Ġkotlin Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġdependencies . set ( analyze Jar Task . flatMap Ġ{ Ġit . all Components Report Ġ}) ĊĊĠĠĠĠĠ Ġoutput . set ( output Paths . abi Analysis Path ) ĊĠĠĠĠĠ Ġabi Dump . set ( output Paths . abi Dump Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġregister Ab i Analysis Task 2 ( abi Ex clusions : ĠProvider < String >): ĠTask Provider < Ab i Analysis Task 2 >? Ġ{ ĊĠĠĠ Ġif Ġ(! has Ab i ) Ġreturn Ġnull ĊĊĠĠĠ Ġreturn Ġproject . tasks . register < Ab i Analysis Task 2 >(" abi Analysis $ variant Name Capital ized ") Ġ{ ĊĠĠĠĠĠ Ġjava Compile Task ()?. let Ġ{ Ġjava Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġkotlin Compile Task ()?. let Ġ{ Ġkotlin Classes . from ( it . get (). outputs . files . as File Tree ) Ġ} ĊĠĠĠĠĠ Ġex clusions . set ( abi Ex clusions ) ĊĠĠĠĠĠ Ġoutput . set ( output Paths . abi Analysis Path ) ĊĠĠĠĠĠ Ġabi Dump . set ( output Paths . abi Dump Path ) ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ