Turn DesugaredLibraryMismatchDiagnostic into a warning
Some build setups cause the DesugaredLibraryMismatchDiagnostic error.
However, the builds are equivalent with classic desugar builds, which
do not have this type of test.
RELNOTES: None
@@ -25,7 +25,9 @@ import com.android.tools.r8.D8;
import com.android.tools.r8.D8Command;
import com.android.tools.r8.Diagnostic;
import com.android.tools.r8.DiagnosticsHandler;
+import com.android.tools.r8.DiagnosticsLevel;
import com.android.tools.r8.StringResource;
+import com.android.tools.r8.errors.DesugaredLibraryMismatchDiagnostic;
import com.android.tools.r8.errors.InterfaceDesugarMissingTypeDiagnostic;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.android.Converters.ExistingPathConverter;
@@ -424,6 +426,14 @@ public class Desugar {
}
DiagnosticsHandler.super.warning(warning);
}
+
+ @Override
+ public DiagnosticsLevel modifyDiagnosticsLevel(DiagnosticsLevel level, Diagnostic diagnostic) {
+ if (diagnostic instanceof DesugaredLibraryMismatchDiagnostic) {
+ return DiagnosticsLevel.WARNING;
+ }
+ return level;
+ }
}
private void desugar(
