Archive remaining artifacts for new gradle

Change-Id: If07af285829219dc4b511cd0e6d65fe94e18a10a
diff --git a/d8_r8/main/build.gradle.kts b/d8_r8/main/build.gradle.kts
index b1a2db5..ba2c1a9 100644
--- a/d8_r8/main/build.gradle.kts
+++ b/d8_r8/main/build.gradle.kts
@@ -72,7 +72,7 @@
       libraryLicenseFiles,
       mainJarDependencies().map(::zipTree))
 
-    val license = rootProject.layout.buildDirectory.file("generatedLicense/LICENSE").get().asFile
+    val license = getRoot().resolveAll("build", "generatedLicense", "LICENSE")
     outputs.files(license)
 
     doLast {
diff --git a/d8_r8/test/build.gradle.kts b/d8_r8/test/build.gradle.kts
index fa1729c..b7fd7b5 100644
--- a/d8_r8/test/build.gradle.kts
+++ b/d8_r8/test/build.gradle.kts
@@ -315,8 +315,7 @@
     from(resourceShrinkerSourcesTask.outputs.files.map(::zipTree))
     from(keepAnnoSourcesTask.outputs.files.map(::zipTree))
     archiveClassifier.set("sources")
-    // Because we use the sources classifier this will be r8-sources.jar.
-    archiveBaseName.set("r8")
+    archiveFileName.set("r8-src.jar")
     destinationDirectory.set(getRoot().resolveAll("build", "libs"))
   }
 
diff --git a/tools/archive.py b/tools/archive.py
index 21ca4d4..8b136ec 100755
--- a/tools/archive.py
+++ b/tools/archive.py
@@ -173,11 +173,19 @@
     # The '-Pno_internal' flag is important because we generate the lib based on uses in tests.
     if (not options.skip_gradle_build):
       if (new_gradle):
-        gradle.RunGradle([':main:swissArmyKnife',
-                          ':main:r8WithRelocatedDeps',
-                          ':test:r8LibWithRelocatedDeps',
-                          ':test:r8LibNoDeps',
-                          '-Pno_internal'], new_gradle=True)
+        gradle.RunGradle([
+            ':keepanno:keepAnnoJar',
+            ':main:consolidatedLicense',
+            ':main:r8WithRelocatedDeps',
+            ':main:swissArmyKnife',
+            ':test:r8LibNoDeps',
+            ':test:r8LibWithRelocatedDeps',
+            ':test:retraceNoDeps',
+            ':test:retraceWithRelocatedDeps',
+            ':test:sourcesJar',
+            ':test:sourcesJar',
+            '-Pno_internal'
+        ], new_gradle=True)
       else:
         gradle.RunGradle([
             utils.R8,
@@ -250,18 +258,15 @@
         utils.DESUGAR_CONFIGURATION_JDK11_MINIMAL_MAVEN_ZIP,
         utils.DESUGAR_CONFIGURATION_JDK11_MAVEN_ZIP,
         utils.DESUGAR_CONFIGURATION_JDK11_NIO_MAVEN_ZIP,
-    ]
-    if (not new_gradle):
-      for_archiving.extend([
-          utils.R8_SRC_JAR,
-          utils.R8RETRACE_JAR,
-          utils.R8RETRACE_JAR + '.map',
-          utils.R8RETRACE_JAR + '_map.zip',
-          utils.R8RETRACE_EXCLUDE_DEPS_JAR,
-          utils.R8RETRACE_EXCLUDE_DEPS_JAR + '.map',
-          utils.R8RETRACE_EXCLUDE_DEPS_JAR + '_map.zip',
-          utils.KEEPANNO_ANNOTATIONS_JAR,
-          utils.GENERATED_LICENSE])
+        utils.R8_SRC_JAR,
+        utils.R8RETRACE_JAR,
+        utils.R8RETRACE_JAR + '.map',
+        utils.R8RETRACE_JAR + '_map.zip',
+        utils.R8RETRACE_EXCLUDE_DEPS_JAR,
+        utils.R8RETRACE_EXCLUDE_DEPS_JAR + '.map',
+        utils.R8RETRACE_EXCLUDE_DEPS_JAR + '_map.zip',
+        utils.KEEPANNO_ANNOTATIONS_JAR,
+        utils.GENERATED_LICENSE]
     for file in for_archiving:
       file_name = os.path.basename(file)
       tagged_jar = os.path.join(temp, file_name)