package Ġcom . ap ol log raph ql . apollo . gradle . internal Ċ Ċ import Ġcom . ap ol log raph ql . apollo . compiler . parser . int rospection . Int rospection Schema Ċ import Ġcom . ap ol log raph ql . apollo . compiler . parser . int rospection . Int rospection Schema . Companion . wrap Ċ import Ġcom . ap ol log raph ql . apollo . compiler . parser . int rospection . to SDL Ċ import Ġcom . ap ol log raph ql . apollo . compiler . parser . sdl . Graph S dl Schema Ċ import Ġcom . ap ol log raph ql . apollo . compiler . parser . sdl . toInt rospection Schema Ċ import Ġcom . ap ol log raph ql . apollo . compiler . toJson Ċ import Ġorg . gradle . api . Default Task Ċ import Ġorg . gradle . api . provider . Property Ċ import Ġorg . gradle . api . tasks . Input Ċ import Ġorg . gradle . api . tasks . Optional Ċ import Ġorg . gradle . api . tasks . OutputFile Ċ import Ġorg . gradle . api . tasks . Task Action Ċ import Ġorg . gradle . api . tasks . options . Option Ċ import Ġjava . io . File Ċ Ċ abstract Ġclass ĠApollo Convert Schema Task : ĠDefault Task () Ġ{ ĊĠ Ġ@ get : Input ĊĠ Ġ@ get : Option ( option Ġ= Ġ" from ", Ġdescription Ġ= Ġ" schema Ġto Ġconvert Ġfrom ") ĊĠ Ġabstract Ġval Ġfrom : ĠProperty < String > ĊĊĠ Ġ@ get : OutputFile ĊĠ Ġ@ get : Option ( option Ġ= Ġ" to ", Ġdescription Ġ= Ġ" schema Ġto Ġconvert Ġto ") ĊĠ Ġabstract Ġval Ġto : ĠProperty < String > ĊĊĠ Ġprivate Ġfun ĠFile . is Int rospection () Ġ= Ġextension Ġ== Ġ" json " ĊĠ Ġfun Ġconvert ( from : ĠFile , Ġto : ĠFile ) Ġ{ ĊĠĠĠ Ġcheck Ġ( from . is Int rospection () Ġ&& Ġ! to . is Int rospection () Ġ|| Ġ! from . is Int rospection () Ġ&& Ġto . is Int rospection ()) Ġ{ ĊĠĠĠĠĠ Ġ" Cannot Ġconvert Ġfrom Ġ${ from . name } Ġto Ġ${ to . name }, Ġthey Ġare Ġalready Ġthe Ġsame Ġformat " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġif Ġ( from . is Int rospection ()) Ġ{ ĊĠĠĠĠĠ ĠInt rospection Schema ( from ). to SDL ( to ) ĊĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠ ĠGraph S dl Schema ( from ). toInt rospection Schema (). wrap (). toJson ( to ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Task Action ĊĠ Ġfun Ġtask Action () Ġ{ ĊĠĠĠ Ġ// ĠDo Ġnot Ġuse ĠProject . file () Ġas Ġfrom Ġthe Ġcommand Ġline , Ġwe Ġexpect Ġthe Ġfile Ġto Ġbe Ġresolved Ġbased Ġon Ġcwd ĊĠĠĠ Ġconvert ( File ( from . get ()), ĠFile ( to . get ())) ĊĠ Ġ} Ċ } Ċ