Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gutenberg] Force using release variants for editor libraries #18760

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libs/editor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ android {
targetSdkVersion rootProject.targetSdkVersion
}

buildTypes {
debug {
minifyEnabled true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just and FYI and as per the documentation when minifyEnabled is set to true then this enables code shrinking, obfuscation, and optimization for only your project's release build type. Make sure to use a build variant with 'isDebuggable=false'.

PS: I am not sure if that's what you want and whether this will help the editor to load faster. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Petros, this code was a hacky experiment to see if I could "trick" the debug variant into matching the main app's release variant. 😅 It didn't appear to have any impact on the editor's load time, and from your comments it does seem like it isn't a viable approach to continue experimenting with. Really appreciate your expertise here. 🙇‍♀️

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just and FYI and as per the documentation when proguardFiles is configured then this includes the default ProGuard rules files that are packaged with the Android Gradle plugin.

PS: I am not sure this will work as there is no proguard.cfg file for the editor module, we only got that on the WordPress module. 🤔

}
}

// Avoid 'duplicate files during packaging of APK' errors
packagingOptions {
exclude 'LICENSE.txt'
Expand Down