Move CustomConversion gradle task to third_party and test

Bug: b/291198792
Change-Id: If8744f32b465a5e49570ce2d6feaefadeaae2aeb
diff --git a/tools/archive.py b/tools/archive.py
index 27c3b25..dda7ee2 100755
--- a/tools/archive.py
+++ b/tools/archive.py
@@ -3,11 +3,13 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-import create_maven_release
-import gradle
 import jdk
 import optparse
 import os
+
+import create_maven_release
+import gradle
+
 try:
   import resource
 except ImportError:
@@ -16,10 +18,8 @@
 import shutil
 import subprocess
 import sys
-import toolhelper
 import utils
 import zipfile
-from build_r8lib import build_r8lib
 
 ARCHIVE_BUCKET = 'r8-releases'
 
@@ -165,7 +165,6 @@
           utils.R8LIB_NO_DEPS,
           utils.R8RETRACE,
           utils.R8RETRACE_NO_DEPS,
-          utils.LIBRARY_DESUGAR_CONVERSIONS,
           utils.KEEPANNO_ANNOTATIONS_TARGET,
           '-Pno_internal'
       ])
diff --git a/tools/utils.py b/tools/utils.py
index c737776..b7266ed 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -5,6 +5,7 @@
 # Different utility functions used accross scripts
 
 import hashlib
+import jdk
 import json
 import os
 import re
@@ -16,7 +17,6 @@
 import zipfile
 
 import defines
-import jdk
 from thread_utils import print_thread
 
 ANDROID_JAR_DIR = 'third_party/android_jar/lib-v{api}'
@@ -35,6 +35,8 @@
 BUILD_JAVA_MAIN_DIR = os.path.join(BUILD, 'classes', 'java', 'main')
 BUILD_TEST_DIR = os.path.join(BUILD, 'classes', 'test')
 LIBS = os.path.join(BUILD, 'libs')
+CUSTOM_CONVERSION_DIR = os.path.join(
+    THIRD_PARTY, 'openjdk', 'desugar_jdk_libs', 'custom_conversion')
 GENERATED_LICENSE_DIR = os.path.join(BUILD, 'generatedLicense')
 SRC_ROOT = os.path.join(REPO_ROOT, 'src', 'main', 'java')
 TEST_ROOT = os.path.join(REPO_ROOT, 'src', 'test', 'java')
@@ -47,7 +49,6 @@
 R8RETRACE = 'R8Retrace'
 R8RETRACE_NO_DEPS = 'R8RetraceNoDeps'
 R8_SRC = 'sourceJar'
-LIBRARY_DESUGAR_CONVERSIONS = 'buildLibraryDesugarConversions'
 R8_TESTS_TARGET = 'TestJar'
 R8_TESTS_DEPS_TARGET = 'RepackageTestDeps'
 R8LIB_TESTS_TARGET = 'configureTestForR8Lib'
@@ -70,8 +71,10 @@
 R8LIB_TESTS_DEPS_JAR = R8_TESTS_DEPS_JAR
 MAVEN_ZIP = os.path.join(LIBS, 'r8.zip')
 MAVEN_ZIP_LIB = os.path.join(LIBS, 'r8lib.zip')
-LIBRARY_DESUGAR_CONVERSIONS_LEGACY_ZIP = os.path.join(LIBS, 'library_desugar_conversions_legacy.jar')
-LIBRARY_DESUGAR_CONVERSIONS_ZIP = os.path.join(LIBS, 'library_desugar_conversions.jar')
+LIBRARY_DESUGAR_CONVERSIONS_LEGACY_ZIP = os.path.join(
+    CUSTOM_CONVERSION_DIR, 'library_desugar_conversions_legacy.jar')
+LIBRARY_DESUGAR_CONVERSIONS_ZIP = os.path.join(
+    CUSTOM_CONVERSION_DIR, 'library_desugar_conversions.jar')
 KEEPANNO_ANNOTATIONS_JAR = os.path.join(LIBS, 'keepanno-annotations.jar')
 
 DESUGAR_CONFIGURATION = os.path.join(