From 3d0d426d466e0499acbd86341f2afe851bd6b3d5 Mon Sep 17 00:00:00 2001 From: Jagdeep Nagpal Date: Fri, 29 Apr 2016 05:17:56 -0700 Subject: [PATCH] Renamed --flavor to --variant Summary: This small update to runAndroid.js which renames --flavor to --variant. ~~`react-native run-android --flavor=staging`~~ ~~doesn't work as it needs build type as well~~ ~~so at present it needs to be like this~~ ~~`react-native run-android --flavor=stagingDebug`~~ ~~it looks messy, instead if we want to use the original spec then Debug must be concatenated to the end all the time as run-android was speced to trigger only debug builds~~ Closes https://github.com/facebook/react-native/pull/7036 Differential Revision: D3240692 Pulled By: mkonicek fb-gh-sync-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581 fbshipit-source-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581 --- local-cli/runAndroid/runAndroid.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/local-cli/runAndroid/runAndroid.js b/local-cli/runAndroid/runAndroid.js index 60f5040ed..864f5bbba 100644 --- a/local-cli/runAndroid/runAndroid.js +++ b/local-cli/runAndroid/runAndroid.js @@ -39,6 +39,10 @@ function _runAndroid(argv, config, resolve, reject) { command: 'flavor', type: 'string', required: false, + }, { + command: 'variant', + type: 'string', + required: false, }], argv); args.root = args.root || ''; @@ -76,7 +80,14 @@ function buildAndRun(args, reject) { : './gradlew'; const gradleArgs = []; - if (args['flavor']) { + if (args['variant']) { + gradleArgs.push('install' + + args['variant'][0].toUpperCase() + args['variant'].slice(1) + ); + } else if (args['flavor']) { + console.warn(chalk.yellow( + `--flavor has been deprecated. Use --variant instead` + )); gradleArgs.push('install' + args['flavor'][0].toUpperCase() + args['flavor'].slice(1) );