Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix devDisabledInStaging not working with multiple productFlavors (#3…
…0606) Summary: Fixes #27052 Since react-native 0.62, the `devDisabledIn${buildType}` syntax has stopped working for apps with multiple `productFlavors`. This PR adds the `disableDevForVariant` lambda to allow dev mode to be disabled for different variants. ## 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 devDisabledIn not working with multiple productFlavors Pull Request resolved: #30606 Test Plan: I added the following log into `react.gradle` and ran the Android build for my app: ``` println("devEnabled: ${targetName}, ${devEnabled}") ``` ``` # build.gradle project.ext.react = [ entryFile: "index.android.js", enableHermes: true, // clean and rebuild if changing bundleInLive: true, disableDevForVariant: { def variant -> variant.name.toLowerCase().contains('release') || variant.name.toLowerCase().contains('live') }, ] ... flavorDimensions 'branding' productFlavors { cve { dimension 'branding' } whce { dimension 'branding' } } ``` Console output: ``` Reading env from: env/cve/live devEnabled: CveDebug, true devEnabled: CveRelease, false devEnabled: CveLive, false devEnabled: WhceDebug, true devEnabled: WhceRelease, false devEnabled: WhceLive, false ``` Reviewed By: cortinico Differential Revision: D31649977 Pulled By: ShikaSD fbshipit-source-id: 520734314f4bca7608b8dca67c7c5ce0be6d31a5
- Loading branch information