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
This commit is contained in:
Jagdeep Nagpal 2016-04-29 05:17:56 -07:00 committed by Facebook Github Bot 0
parent 0045e07928
commit 3d0d426d46
1 changed files with 12 additions and 1 deletions

View File

@ -39,6 +39,10 @@ function _runAndroid(argv, config, resolve, reject) {
command: 'flavor', command: 'flavor',
type: 'string', type: 'string',
required: false, required: false,
}, {
command: 'variant',
type: 'string',
required: false,
}], argv); }], argv);
args.root = args.root || ''; args.root = args.root || '';
@ -76,7 +80,14 @@ function buildAndRun(args, reject) {
: './gradlew'; : './gradlew';
const gradleArgs = []; 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' + gradleArgs.push('install' +
args['flavor'][0].toUpperCase() + args['flavor'].slice(1) args['flavor'][0].toUpperCase() + args['flavor'].slice(1)
); );