Skip to content

Commit 3d0d426

Browse files
jaggs6Facebook Github Bot 0
authored andcommitted
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 facebook#7036 Differential Revision: D3240692 Pulled By: mkonicek fb-gh-sync-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581 fbshipit-source-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581
1 parent 0045e07 commit 3d0d426

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

local-cli/runAndroid/runAndroid.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ function _runAndroid(argv, config, resolve, reject) {
3939
command: 'flavor',
4040
type: 'string',
4141
required: false,
42+
}, {
43+
command: 'variant',
44+
type: 'string',
45+
required: false,
4246
}], argv);
4347

4448
args.root = args.root || '';
@@ -76,7 +80,14 @@ function buildAndRun(args, reject) {
7680
: './gradlew';
7781

7882
const gradleArgs = [];
79-
if (args['flavor']) {
83+
if (args['variant']) {
84+
gradleArgs.push('install' +
85+
args['variant'][0].toUpperCase() + args['variant'].slice(1)
86+
);
87+
} else if (args['flavor']) {
88+
console.warn(chalk.yellow(
89+
`--flavor has been deprecated. Use --variant instead`
90+
));
8091
gradleArgs.push('install' +
8192
args['flavor'][0].toUpperCase() + args['flavor'].slice(1)
8293
);

0 commit comments

Comments
 (0)