Skip to content

Commit

Permalink
Turn DesugaredLibraryMismatchDiagnostic into a warning
Browse files Browse the repository at this point in the history
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
PiperOrigin-RevId: 371871743
  • Loading branch information
sgjesse authored and copybara-github committed May 4, 2021
1 parent ced45af commit 6b1e9a6
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
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;
Expand Down Expand Up @@ -424,6 +426,14 @@ public void warning(Diagnostic warning) {
}
DiagnosticsHandler.super.warning(warning);
}

@Override
public DiagnosticsLevel modifyDiagnosticsLevel(DiagnosticsLevel level, Diagnostic diagnostic) {
if (diagnostic instanceof DesugaredLibraryMismatchDiagnostic) {
return DiagnosticsLevel.WARNING;
}
return level;
}
}

private void desugar(
Expand Down

0 comments on commit 6b1e9a6

Please sign in to comment.