mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Ref https://github.com/facebook/react-native/pull/30606#issuecomment-948458552 ## Changelog [Android] [Added] - Add bundleForVariant option Pull Request resolved: https://github.com/facebook/react-native/pull/32472 Test Plan: I added the following log into react.gradle and ran the Android build for my app: ``` println("bundleEnabled: ${targetName}, ${bundleForVariant(variant)}") ``` ``` # build.gradle project.ext.react = [ entryFile: "index.android.js", enableHermes: true, // clean and rebuild if changing bundleForVariant: { 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 bundleEnabled: CveDebug, false bundleEnabled: CveRelease, true bundleEnabled: CveLive, true bundleEnabled: WhceDebug, false bundleEnabled: WhceRelease, true bundleEnabled: WhceLive, true ``` Reviewed By: cortinico, ryancat Differential Revision: D31910406 Pulled By: ShikaSD fbshipit-source-id: baca5efaddedddad15d974cc7bb8f3c2a4c4f35b