aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/proguard.flags17
-rw-r--r--core/proguard_basic_keeps.flags13
-rw-r--r--envsetup.sh5
3 files changed, 17 insertions, 18 deletions
diff --git a/core/proguard.flags b/core/proguard.flags
index 53f63d8ea0..d790061524 100644
--- a/core/proguard.flags
+++ b/core/proguard.flags
@@ -9,14 +9,19 @@
# Add this flag in your package's own configuration if it's needed.
#-flattenpackagehierarchy
-# Keep classes and methods that have @VisibleForTesting annotations, except in
-# intermediate libraries that export those annotations (e.g., androidx, guava).
-# This avoids keeping library-specific test code that isn't actually needed
-# for platform testing.
+# Keep classes and members with the platform-defined @VisibleForTesting annotation.
+-keep @com.android.internal.annotations.VisibleForTesting class *
+-keepclassmembers class * {
+ @com.android.internal.annotations.VisibleForTesting *;
+}
+
+# Keep classes and members with non-platform @VisibleForTesting annotations, but
+# only within platform-defined packages. This avoids keeping external, library-specific
+# test code that isn't actually needed for platform testing.
# TODO(b/239961360): Migrate away from androidx.annotation.VisibleForTesting
# and com.google.common.annotations.VisibleForTesting use in platform code.
--keep @**.VisibleForTesting class !androidx.**,!com.google.common.**,*
--keepclassmembers class !androidx.**,!com.google.common.**,* {
+-keep @**.VisibleForTesting class android.**,com.android.**,com.google.android.**
+-keepclassmembers class android.**,com.android.**,com.google.android.** {
@**.VisibleForTesting *;
}
diff --git a/core/proguard_basic_keeps.flags b/core/proguard_basic_keeps.flags
index ea200c187f..7e7b2701ca 100644
--- a/core/proguard_basic_keeps.flags
+++ b/core/proguard_basic_keeps.flags
@@ -83,14 +83,13 @@
# 1) runtime-visible annotations will still be kept, and 2) compile-time
# annotations are stripped by R8 anyway.
# Note: The ** prefix is used to accommodate jarjar repackaging.
-# TODO(b/266561579): Remove this exemptions after resolving jarjar-ed transitive libs
+# TODO(b/242088131): Remove these exemptions after resolving transitive libs
+# dependencies that are provided to R8.
-dontwarn **android**.annotation*.**
-
-# These classes generate warnings of the kind `Library class extends program class`
-# because some apps have deps that statically include the same libraries as the app,
-# and r8 complains that a library is implementing a class provided by the app (the "program").
--dontwarn com.google.protobuf.**
--dontwarn kotlin.reflect.jvm.internal.ReflectionFactoryImpl
+-dontwarn **com.google.errorprone.annotations.**
+-dontwarn javax.annotation.**
+-dontwarn org.checkerframework.**
+-dontwarn org.jetbrains.annotations.**
# Less spammy.
-dontnote
diff --git a/envsetup.sh b/envsetup.sh
index 32e1a328a2..027262473e 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1881,11 +1881,6 @@ function _wrap_build()
color_reset=""
fi
- if [[ "x${USE_RBE}" == "x" && $mins -gt 15 && "${ANDROID_BUILD_ENVIRONMENT_CONFIG}" == "googler" ]]; then
- echo
- echo "${color_warning}Start using RBE (http://go/build-fast) to get faster builds!${color_reset}"
- fi
-
echo
if [ $ret -eq 0 ] ; then
echo -n "${color_success}#### build completed successfully "