-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Fix hermesFlagsRelease not working with multiple productFlavors #31040
Conversation
Base commit: 438a4cf |
Base commit: 438a4cf |
@@ -186,7 +186,7 @@ afterEvaluate { | |||
def hermesFlags; | |||
def hbcTempFile = file("${jsBundleFile}.hbc") | |||
exec { | |||
if (targetName.toLowerCase().contains("release")) { | |||
if (!targetName.toLowerCase().contains("debug")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure changing this logic for everyone won’t break the build somewhere (assuming that some people may have custom debug-oriented buildTypes). Maybe the best solution would be to introduce a lambda similar to enableHermesForVariant
or flag like we have with bundleIn$targetName
, and configure this logic from outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that probably is a better solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@grit96, were you going to make the change based on the suggestion?
Hi! Closing this PR since the comment hasn't been addressed for a while. Please reopen and ping me if you are still up for working on this. Thanks for your time! |
Summary: Ref #25601 (comment). From #31040. The `hermesFlagsRelease` option only works with the release build type, but not with other build types. This PR allows hermes flags on a per variant basis to be specified using the `hermesFlagsForVariant` lambda. It also allows the hermes debugger cleanup to be run on a per variant basis using the `deleteDebugFilesForVariant` lambda. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Android] [Fixed] - Fix hermesFlags not working with multiple variants Pull Request resolved: #32281 Test Plan: Set the following options in `android/app/build.gradle` and ensure warnings are hidden when running `./gradlew assembleRelease` and `./gradlew assembleLive`. ``` hermesFlagsForVariant: { def v -> v.name.toLowerCase().contains('release') || v.name.toLowerCase().contains('live') ? ['-w'] : [] }, deleteDebugFilesForVariant: { def v -> v.name.toLowerCase().contains('release') || v.name.toLowerCase().contains('live') }, ``` Reviewed By: cortinico Differential Revision: D31234241 Pulled By: ShikaSD fbshipit-source-id: 2cb3dd63adbcd023061076b5a3b262a87b470518
Ref #25601 (comment).
Summary
The
hermesFlagsRelease
option only works with the release build type, but not with other build types. This PR considers other build types as release and enableshermesFlagsRelease
to apply to any non-debug build type.Changelog
[Android] [Fixed] - Fix hermesFlagsRelease not working with multiple productFlavors
Test Plan
Set
hermesFlagsRelease: ["-w"]
inandroid/app/build.gradle
and ensure warnings are hidden when running./gradlew assembleRelease
and./gradlew assembleLive
.