Reland "Generate method lists for lint based on library desugar configuration"
This reverts commit 40fe34dfdddfa1bfeca659f76964d6f76cedcd43 and fixes the
build issue by generating the desugar configuration maven zip after an r8.jar
with dependencies has been built.
Bug: 134732760
Change-Id: Ice744eb738556e32c77932e24f95f6cb488209aa
diff --git a/tools/create_maven_release.py b/tools/create_maven_release.py
index b4343f3..30c14c8 100755
--- a/tools/create_maven_release.py
+++ b/tools/create_maven_release.py
@@ -6,6 +6,7 @@
import argparse
import gradle
import hashlib
+import jdk
import json
from os import makedirs
from os.path import join
@@ -338,6 +339,19 @@
configuration_dir = join(tmp_dir, 'META-INF', 'desugar', 'd8')
makedirs(configuration_dir)
copyfile(configuration, join(configuration_dir, 'desugar.json'))
+
+ lint_dir = join(configuration_dir, 'lint')
+ makedirs(lint_dir)
+ cmd = [
+ jdk.GetJavaExecutable(),
+ '-cp',
+ utils.R8_JAR,
+ 'com.android.tools.r8.GenerateLintFiles',
+ configuration,
+ lint_dir]
+ utils.PrintCmd(cmd)
+ subprocess.check_call(cmd)
+
make_archive(destination, 'zip', tmp_dir)
move(destination + '.zip', destination)