Update archive_desugar_jdk_libs to new gradle
Bug: 270105162
Change-Id: I8a5dad973651afc7fc17f773acf0366c9922e82a
diff --git a/d8_r8/test/build.gradle.kts b/d8_r8/test/build.gradle.kts
index a0119aa..dec191b 100644
--- a/d8_r8/test/build.gradle.kts
+++ b/d8_r8/test/build.gradle.kts
@@ -50,7 +50,8 @@
from(java8TestJarTask.outputs.files.map(::zipTree))
exclude("META-INF/*.kotlin_module")
exclude("**/*.kotlin_metadata")
- archiveFileName.set("all-tests.jar")
+ destinationDirectory.set(getRoot().resolveAll("build", "libs"))
+ archiveFileName.set("r8tests.jar")
}
val allDepsJar by registering(Jar::class) {
@@ -61,7 +62,8 @@
exclude("META-INF/*.kotlin_module")
exclude("**/*.kotlin_metadata")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
- archiveFileName.set("all-deps.jar")
+ destinationDirectory.set(getRoot().resolveAll("build", "libs"))
+ archiveFileName.set("test_deps_all.jar")
}
val allTestsJarRelocated by registering(Exec::class) {
diff --git a/tools/archive_desugar_jdk_libs.py b/tools/archive_desugar_jdk_libs.py
index b475941..577b305 100755
--- a/tools/archive_desugar_jdk_libs.py
+++ b/tools/archive_desugar_jdk_libs.py
@@ -253,7 +253,10 @@
file.write(hexdigest)
def Undesugar(variant, maven_zip, version, undesugared_maven_zip):
- gradle.RunGradle(['testJar', 'repackageTestDeps', '-Pno_internal'])
+ gradle.RunGradle([utils.GRADLE_TASK_R8,
+ utils.GRADLE_TASK_TEST_JAR,
+ utils.GRADLE_TASK_TEST_DEPS_JAR,
+ '-Pno_internal'], new_gradle=True)
with utils.TempDir() as tmp:
with zipfile.ZipFile(maven_zip, 'r') as zip_ref:
zip_ref.extractall(tmp)
@@ -270,7 +273,7 @@
buildLibs = os.path.join(defines.REPO_ROOT, 'build', 'libs')
cmd = [jdk.GetJavaExecutable(),
'-cp',
- '%s:%s:%s' % (os.path.join(buildLibs, 'r8_with_deps.jar'), os.path.join(buildLibs, 'r8tests.jar'), os.path.join(buildLibs, 'test_deps_all.jar')),
+ '%s:%s:%s' % (utils.R8_JAR, utils.R8_TESTS_JAR, utils.R8_TESTS_DEPS_JAR),
'com.android.tools.r8.desugar.desugaredlibrary.jdk11.DesugaredLibraryJDK11Undesugarer',
desugar_jdk_libs_jar,
undesugared_jar]
diff --git a/tools/utils.py b/tools/utils.py
index 0c2395d..4b15548 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -53,6 +53,8 @@
GRADLE_TASK_SOURCE_JAR = ':test:sourcesJar'
GRADLE_TASK_SWISS_ARMY_KNIFE = ':main:swissArmyKnife'
GRADLE_TASK_TEST = ':test:test'
+GRADLE_TASK_TEST_DEPS_JAR = ':test:allDepsJar'
+GRADLE_TASK_TEST_JAR = ':test:allTestsJar'
D8 = 'd8'
R8 = 'r8'