Update to Copy a Typer Adapter's Dependent Classes
#desugar #new-android-api-support #desugar-shadowed-api
Previous: unknown commit
Expected a No-op of this CL, since there are no out-of-self depedencies for the current converter classes.
@@ -17,6 +17,7 @@ import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static com.google.devtools.build.android.desugar.LambdaClassMaker.LAMBDA_METAFACTORY_DUMPER_PROPERTY;
+import static com.google.devtools.build.android.desugar.io.FileBasedTypeReferenceClosure.findReachableReferencedTypes;
import static com.google.devtools.build.android.desugar.strconcat.IndyStringConcatDesugaring.INVOKE_JDK11_STRING_CONCAT;
import com.google.auto.value.AutoValue;
@@ -577,7 +578,9 @@ public class Desugar {
private static void copyTypeConverterClasses(
OutputFileProvider outputFileProvider, ImmutableList<ClassName> converterClasses) {
- for (ClassName className : converterClasses) {
+ for (ClassName className :
+ findReachableReferencedTypes(
+ ImmutableSet.copyOf(converterClasses), ClassName::isInDesugarRuntimeLibrary)) {
String resourceName = className.classFilePathName();
try (InputStream stream = Resources.getResource(resourceName).openStream()) {
outputFileProvider.write(resourceName, ByteStreams.toByteArray(stream));
