Remove allowUnusedDontWarnKotlinReflectJvmInternal from DesugaredLibraryTestBuilder
We can simply use allowUnusedDontWarnPatterns() instead.
Change-Id: I3210e10e2301414946145e275033da25a8ccaad7
diff --git a/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinBlogTest.java b/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinBlogTest.java
index e438b81..cfb6e1c 100644
--- a/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinBlogTest.java
+++ b/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinBlogTest.java
@@ -16,6 +16,7 @@
import com.android.tools.r8.ToolHelper.DexVm.Version;
import com.android.tools.r8.desugar.desugaredlibrary.DesugaredLibraryTestBase;
import com.android.tools.r8.desugar.desugaredlibrary.test.CompilationSpecification;
+import com.android.tools.r8.desugar.desugaredlibrary.test.DesugaredLibraryTestBuilder;
import com.android.tools.r8.desugar.desugaredlibrary.test.LibraryDesugaringSpecification;
import com.android.tools.r8.shaking.ProguardKeepAttributes;
import com.android.tools.r8.utils.DescriptorUtils;
@@ -90,17 +91,13 @@
.applyIf(
compilationSpecification.isProgramShrink(),
builder -> builder.addProgramFiles(kotlinc.getKotlinAnnotationJar()))
- .addOptionsModification(
- options -> {
- options.testing.enableD8ResourcesPassThrough = true;
- options.dataResourceConsumer = options.programConsumer.getDataResourceConsumer();
- })
.addKeepMainRule(PKG + ".BlogKt")
.addKeepAllClassesRule()
.addKeepAttributes(ProguardKeepAttributes.RUNTIME_VISIBLE_ANNOTATIONS)
.allowDiagnosticMessages()
- .allowUnusedDontWarnKotlinReflectJvmInternal(
- kotlinParameters.getCompiler().isNot(KOTLINC_1_3_72))
+ .applyIf(
+ kotlinParameters.getCompiler().isNot(KOTLINC_1_3_72),
+ DesugaredLibraryTestBuilder::allowUnusedDontWarnPatterns)
.compile()
.withArt6Plus64BitsLib()
.run(parameters.getRuntime(), PKG + ".BlogKt")
diff --git a/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinMetadataTest.java b/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinMetadataTest.java
index 510e5bb..d6cb58d 100644
--- a/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinMetadataTest.java
+++ b/src/test/java/com/android/tools/r8/desugar/desugaredlibrary/kotlin/KotlinMetadataTest.java
@@ -20,6 +20,7 @@
import com.android.tools.r8.ToolHelper;
import com.android.tools.r8.desugar.desugaredlibrary.DesugaredLibraryTestBase;
import com.android.tools.r8.desugar.desugaredlibrary.test.CompilationSpecification;
+import com.android.tools.r8.desugar.desugaredlibrary.test.DesugaredLibraryTestBuilder;
import com.android.tools.r8.desugar.desugaredlibrary.test.LibraryDesugaringSpecification;
import com.android.tools.r8.kotlin.KotlinMetadataWriter;
import com.android.tools.r8.shaking.ProguardKeepAttributes;
@@ -88,17 +89,13 @@
.applyIf(
compilationSpecification.isProgramShrink(),
builder -> builder.addProgramFiles(kotlinc.getKotlinAnnotationJar()))
- .addOptionsModification(
- options -> {
- options.testing.enableD8ResourcesPassThrough = true;
- options.dataResourceConsumer = options.programConsumer.getDataResourceConsumer();
- })
.addKeepMainRule(PKG + ".MainKt")
.addKeepAllClassesRule()
.addKeepAttributes(ProguardKeepAttributes.RUNTIME_VISIBLE_ANNOTATIONS)
.allowDiagnosticMessages()
- .allowUnusedDontWarnKotlinReflectJvmInternal(
- kotlinParameters.getCompiler().isNot(KOTLINC_1_3_72))
+ .applyIf(
+ kotlinParameters.getCompiler().isNot(KOTLINC_1_3_72),
+ DesugaredLibraryTestBuilder::allowUnusedDontWarnPatterns)
.compile()
.inspect(
i -> {
diff --git a/src/test/testbase/java/com/android/tools/r8/desugar/desugaredlibrary/test/DesugaredLibraryTestBuilder.java b/src/test/testbase/java/com/android/tools/r8/desugar/desugaredlibrary/test/DesugaredLibraryTestBuilder.java
index 2128db5..49cf376 100644
--- a/src/test/testbase/java/com/android/tools/r8/desugar/desugaredlibrary/test/DesugaredLibraryTestBuilder.java
+++ b/src/test/testbase/java/com/android/tools/r8/desugar/desugaredlibrary/test/DesugaredLibraryTestBuilder.java
@@ -246,11 +246,6 @@
return this;
}
- public DesugaredLibraryTestBuilder<T> allowUnusedDontWarnKotlinReflectJvmInternal(boolean allow) {
- withR8TestBuilder(b -> b.allowUnusedDontWarnKotlinReflectJvmInternal(allow));
- return this;
- }
-
public DesugaredLibraryTestBuilder<T> allowDiagnosticInfoMessages() {
withR8TestBuilder(R8TestBuilder::allowDiagnosticInfoMessages);
return this;