Support minifcation for apps that depend on AGP 8 and integration_test (#127628)

- Set exported proguard rules for consumers of integration_test using AGP 8.0 
- Updated proguard usage in example to test setting custom proguard rules works.

#127388

Documentation for how consumerProguardFiles works. https://developer.android.com/studio/projects/android-library#Considerations

Unknown why we had to use ** instead of matching exactly.
This commit is contained in:
Reid Baker 2023-05-26 15:30:44 -04:00 committed by GitHub
parent 5c0eb2d967
commit 9376a2ac60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -41,6 +41,7 @@ android {
defaultConfig {
minSdkVersion 19
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'lib-proguard-rules.txt'
}
dependencies {

View File

@ -0,0 +1,5 @@
# For some reason org.kxml2.io.KXmlParser and org.kxml2.io.KXmlSerializer
# are missing and not marked correctly by dependencies.
# Possibly related to https://github.com/flutter/flutter/issues/56591
# See https://github.com/flutter/flutter/issues/127388 for more context.
-dontwarn org.kxml2.io.KXmlParser**,org.kxml2.io.KXmlSerializer**

View File

@ -55,8 +55,7 @@ android {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

View File

@ -0,0 +1 @@
# Intentionally empty. Validation is that apps can set their own proguard files.