Include custom conversion classes in desugar library configuration

The custom conversion classes are referenced from the configuration
(specified in the JSON file), and is now part of of the desugar
library configuration maven artifact.

Bug: 145393922
Change-Id: I8ebe654e177abed8ad05259774d360b09e8c76de
diff --git a/tools/create_maven_release.py b/tools/create_maven_release.py
index 72186a8..cc36693 100755
--- a/tools/create_maven_release.py
+++ b/tools/create_maven_release.py
@@ -16,6 +16,7 @@
 from string import Template
 import tempfile
 import utils
+import zipfile
 
 DEPENDENCYTEMPLATE = Template(
 """
@@ -333,16 +334,29 @@
       out)
 
 # Write the desugaring configuration of a jar file with the following content:
-#  META-INF
-#    desugar
-#      d8
+#  java/
+#    util/
+#      <java.util conversions classes>
+#    time/
+#      <java.time conversions classes>
+#  META-INF/
+#    desugar/
+#      d8/
 #        desugar.json
-def generate_jar_with_desugar_configuration(configuration, destination):
+#        lint/
+#          <lint files>
+def generate_jar_with_desugar_configuration(configuration, conversions, destination):
   with utils.TempDir() as tmp_dir:
+    # Add conversion classes.
+    with zipfile.ZipFile(conversions, 'r') as conversions_zip:
+      conversions_zip.extractall(tmp_dir)
+
+    # Add configuration
     configuration_dir = join(tmp_dir, 'META-INF', 'desugar', 'd8')
     makedirs(configuration_dir)
     copyfile(configuration, join(configuration_dir, 'desugar.json'))
 
+    # Add lint configuartion.
     lint_dir = join(configuration_dir, 'lint')
     makedirs(lint_dir)
     cmd = [
@@ -367,7 +381,9 @@
   # Generate the jar with the configuration file.
   jar_file = 'desugar_configuration.jar'
   generate_jar_with_desugar_configuration(
-      utils.DESUGAR_CONFIGURATION, jar_file)
+      utils.DESUGAR_CONFIGURATION,
+      utils.LIBRARY_DESUGAR_CONVERSIONS_ZIP,
+      jar_file)
   # Write the maven zip file.
   generate_maven_zip(
       'desugar_jdk_libs_configuration', version, pom_file, jar_file, out)