Add deprecation message for setting android.enableR8

Users should not need to set this property, and in the future
it will become a no-op.

BUG: n/a
Test: manually verified
Change-Id: I682d825a7501e2cab9e52546c71c70835bf0c728
diff --git a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/errors/DeprecationReporter.kt b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/errors/DeprecationReporter.kt
index e84cc6f..6ba1caa 100644
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/errors/DeprecationReporter.kt
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/errors/DeprecationReporter.kt
@@ -45,7 +45,9 @@
         TASK_ACCESS_VIA_VARIANT("at the end of 2019"),
         DSL_USE_PROGUARD(
             "soon. Use 'android.enableR8' in gradle.properties to switch between R8 and Proguard."
-        )
+        ),
+        ENABLE_R8("in a future version of the Android Gradle plugin, and will no longer " +
+                "allow you to disable R8"),
     }
 
     /**
diff --git a/build-system/gradle-core/src/main/java/com/android/build/gradle/options/OptionalBooleanOption.kt b/build-system/gradle-core/src/main/java/com/android/build/gradle/options/OptionalBooleanOption.kt
index 58e6b31..37304ce 100644
--- a/build-system/gradle-core/src/main/java/com/android/build/gradle/options/OptionalBooleanOption.kt
+++ b/build-system/gradle-core/src/main/java/com/android/build/gradle/options/OptionalBooleanOption.kt
@@ -16,6 +16,7 @@
 
 package com.android.build.gradle.options
 
+import com.android.build.gradle.internal.errors.DeprecationReporter
 import com.android.build.gradle.options.Option.Status.STABLE
 import com.android.builder.model.AndroidProject
 
@@ -25,7 +26,7 @@
     SIGNING_V1_ENABLED(AndroidProject.PROPERTY_SIGNING_V1_ENABLED, status = STABLE),
     SIGNING_V2_ENABLED(AndroidProject.PROPERTY_SIGNING_V2_ENABLED, status = STABLE),
     IDE_TEST_ONLY(AndroidProject.PROPERTY_TEST_ONLY, status = STABLE),
-    ENABLE_R8("android.enableR8", status = Option.Status.STABLE),
+    ENABLE_R8("android.enableR8", status = Option.Status.Deprecated(DeprecationReporter.DeprecationTarget.ENABLE_R8)),
 
     /**
      * This project property is read by the firebase plugin, and has no direct impact on AGP behavior.