Temporarily add keeps for enums flowing to library with .class type
Bug: 294351878
Bug: 287398085
Change-Id: I697a3732ff04958efc6aaa2c937cb74864036dcb
diff --git a/d8_r8/r8lib/build.gradle.kts b/d8_r8/r8lib/build.gradle.kts
index 84b8a5e..60365ab 100644
--- a/d8_r8/r8lib/build.gradle.kts
+++ b/d8_r8/r8lib/build.gradle.kts
@@ -67,14 +67,16 @@
val r8 = r8WithRelocatedDepsTask.outputs.files.getSingleFile()
val generatedKeepRules = generateKeepRules.get().outputs.files.getSingleFile()
val keepTxt = getRoot().resolveAll("src", "main", "keep.txt")
- inputs.files(listOf(r8, generatedKeepRules, keepTxt))
+ // TODO(b/294351878): Remove once enum issue is fixed
+ val keepResourceShrinkerTxt = getRoot().resolveAll("src", "main", "keep_r8resourceshrinker.txt")
+ inputs.files(listOf(r8, generatedKeepRules, keepTxt, keepResourceShrinkerTxt))
val output = file(Paths.get("build", "libs", "r8lib-deps-relocated.jar"))
outputs.file(output)
commandLine = createR8LibCommandLine(
r8,
r8,
output,
- listOf(keepTxt, generatedKeepRules),
+ listOf(keepTxt, generatedKeepRules, keepResourceShrinkerTxt),
false)
}
diff --git a/src/main/keep_r8resourceshrinker.txt b/src/main/keep_r8resourceshrinker.txt
new file mode 100644
index 0000000..f7c7166
--- /dev/null
+++ b/src/main/keep_r8resourceshrinker.txt
@@ -0,0 +1,8 @@
+# Copyright (c) 2023, the R8 project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# TODO(b/294351878): Remove once enum issue is fixed.
+-keep class com.android.resources.ResourceType { *; }
+
+-keep class com.android.resources.ResourceFolderType { *; }