Converting extractHiltJar to a Copy task so it doesn't print its progress

Bug: 140635374
Test: rm ../../out/androidx/hilt/hilt-compiler/build/extractedJar -rf && ./gradlew :hilt:hilt-compiler:extractHiltJar && ls ../../out/androidx/hilt/hilt-compiler/build/extractedJar/classes.jar

Change-Id: I15955f81d3a51c62e70289d5095bcfdf662689ed
diff --git a/hilt/hilt-compiler/build.gradle b/hilt/hilt-compiler/build.gradle
index 9ae3ab0..f452650 100644
--- a/hilt/hilt-compiler/build.gradle
+++ b/hilt/hilt-compiler/build.gradle
@@ -62,15 +62,13 @@
 }
 
 // Extract Hilt classes.jar to be used for compile-testing.
-tasks.register("extractHiltJar", Exec).configure {
+tasks.register("extractHiltJar", Copy).configure {
     def aarPath = project.configurations.testRuntimeClasspath.find {
         it.path.contains("com/google/dagger/hilt-android/") && it.name.endsWith(".aar")
     }
-    inputs.file(aarPath)
-    outputs.dir(new File(project.buildDir, "extractedJar"))
-    workingDir(project.buildDir)
-    executable("unzip")
-    args("-o", "$aarPath", "classes.jar", "-d", "extractedJar")
+    from project.zipTree(aarPath)
+    into new File(project.buildDir, "extractedJar")
+    include "classes.jar"
 }
 
 tasks.named("compileKotlin").configure {