react-native-macos/packages
Geraint White 91adb761cf Add hermesFlagsForVariant and deleteDebugFilesForVariant (#32281)
Summary:
Ref https://github.com/facebook/react-native/issues/25601#issuecomment-510856047.

From https://github.com/facebook/react-native/pull/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: https://github.com/facebook/react-native/pull/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
2021-10-13 12:50:25 -07:00
..
assets Support nonstandard pixel densities for Android drawables 2021-09-09 08:19:42 -07:00
babel-plugin-codegen Use deep require instead of Haste for NativeComponentRegistry 2021-09-27 13:47:28 -07:00
eslint-config-react-native-community Bump the version of @react-native-community/eslint-config (#32117) 2021-08-31 16:26:52 -07:00
eslint-plugin-codegen Upgrade babel from 7.12.3 -> 7.14.1 2021-05-13 02:48:09 -07:00
eslint-plugin-react-native-community RN: Replace `master` with `main` in Documentation 2021-07-15 15:22:57 -07:00
normalize-color RN: @react-native/normalize-color support Node.js 2021-09-01 01:26:56 -07:00
polyfills Bump @react-native/polyfills version (#32074) 2021-08-25 12:14:02 -07:00
react-native-codegen Use deep require instead of Haste for NativeComponentRegistry 2021-09-27 13:47:28 -07:00
react-native-gradle-plugin Add hermesFlagsForVariant and deleteDebugFilesForVariant (#32281) 2021-10-13 12:50:25 -07:00
rn-tester Remove libstdc++ dependency (#32247) 2021-10-08 14:16:54 -07:00