Desugared library: add dump support

Bug: 171195238
Change-Id: I5ebf1ae4d055380b85030a544b22b06726a643fe
diff --git a/tools/compiledump.py b/tools/compiledump.py
index 90a696d..fa9518c 100755
--- a/tools/compiledump.py
+++ b/tools/compiledump.py
@@ -78,6 +78,10 @@
       help='Set min-api (default read from dump properties file)',
       default=None)
   parser.add_argument(
+    '--desugared-lib',
+    help='Set desugared-library (default set from dump)',
+    default=None)
+  parser.add_argument(
     '--loop',
     help='Run the compilation in a loop',
     default=False,
@@ -119,6 +123,9 @@
   def classpath_jar(self):
     return self.if_exists('classpath.jar')
 
+  def desugared_library_json(self):
+    return self.if_exists('desugared-library.json')
+
   def build_properties_file(self):
     return self.if_exists('build.properties')
 
@@ -252,6 +259,8 @@
       cmd.extend(['--lib', dump.library_jar()])
     if dump.classpath_jar():
       cmd.extend(['--classpath', dump.classpath_jar()])
+    if dump.desugared_library_json():
+      cmd.extend(['--desugared-lib', dump.desugared_library_json()])
     if compiler != 'd8' and dump.config_file():
       cmd.extend(['--pg-conf', dump.config_file()])
     if compiler != 'd8':