From 06a73ca8569c5f03e62566e293ac9534ecf624ae Mon Sep 17 00:00:00 2001 From: Philip Cohn-Cort Date: Wed, 11 Mar 2020 01:00:53 -0400 Subject: [PATCH] Use gradle.properties to control what kind of code optimization runs --- build.gradle | 6 +++--- gradle.properties | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 5960738e..ab79b87e 100644 --- a/build.gradle +++ b/build.gradle @@ -56,12 +56,12 @@ android { buildTypes { debug { minifyEnabled true - useProguard true signingConfig signingConfigs.debug } - release { //keep on 'release' for faster builds, set to 'all' when testing to make sure proguard is not deleting important stuff + // keep minifyEnabled false above for faster builds; set to 'true' + // when testing to make sure ProGuard/R8 is not deleting important stuff + release { minifyEnabled true - useProguard true } } } diff --git a/gradle.properties b/gradle.properties index 5465fec0..c87083bf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,11 @@ android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file +android.useAndroidX=true +### +# This 'android.enableR8' property only matters when the current +# build variant has 'minifyEnabled true'. +# +# Set this to false to use ProGuard. +# Set this to true to use R8. +# +# Default: true +android.enableR8=false