Skip to content

Commit 4fcd778

Browse files
breaking: remove --variant option (#2026)
1 parent 6f07e7e commit 4fcd778

File tree

4 files changed

+5
-29
lines changed

4 files changed

+5
-29
lines changed

packages/cli-platform-android/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ Builds your app and starts it on a connected Android emulator or device.
2828
2929
Override the root directory for the Android build (which contains the android directory)'.
3030

31-
#### `--variant <string>`
32-
33-
> **DEPRECATED** – use "mode" instead
34-
35-
> default: 'debug'
36-
37-
Specify your app's build variant.
38-
3931
#### `--appFolder <string>`
4032

4133
> **DEPRECATED** – use "project.android.appName" in react-native.config.js
@@ -129,6 +121,7 @@ Installs passed binary instead of building a fresh one. This command is not comp
129121
#### `--user` <number | string>
130122

131123
Id of the User Profile you want to install the app on.
124+
132125
### `log-android`
133126

134127
Usage:

packages/cli-platform-android/src/commands/buildAndroid/index.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {promptForTaskSelection} from '../runAndroid/listAndroidTasks';
1616

1717
export interface BuildFlags {
1818
mode?: string;
19-
variant?: string;
2019
activeArchOnly?: boolean;
2120
packager?: boolean;
2221
port: number;
@@ -63,12 +62,6 @@ async function buildAndroid(
6362
) {
6463
const androidProject = getAndroidProject(config);
6564

66-
if (args.variant) {
67-
logger.warn(
68-
'"variant" flag is deprecated and will be removed in future release. Please switch to "mode" flag.',
69-
);
70-
}
71-
7265
if (args.tasks && args.mode) {
7366
logger.warn(
7467
'Both "tasks" and "mode" parameters were passed to "build" command. Using "tasks" for building the app.',
@@ -89,7 +82,7 @@ async function buildAndroid(
8982

9083
let gradleArgs = getTaskNames(
9184
androidProject.appName,
92-
args.mode || args.variant,
85+
args.mode,
9386
tasks,
9487
'bundle',
9588
androidProject.sourceDir,
@@ -111,7 +104,7 @@ async function buildAndroid(
111104
);
112105
if (architectures.length > 0) {
113106
logger.info(`Detected architectures ${architectures.join(', ')}`);
114-
// `reactNativeDebugArchitectures` was renamed to `reactNativeArchitectures` in 0.68.
107+
// `reactNativeDebugArchitectures` was renamed to `reactNativeArchitectures` in 0.68.
115108
// Can be removed when 0.67 no longer needs to be supported.
116109
gradleArgs.push(
117110
'-PreactNativeDebugArchitectures=' + architectures.join(','),
@@ -144,11 +137,6 @@ export const options = [
144137
name: '--mode <string>',
145138
description: "Specify your app's build variant",
146139
},
147-
{
148-
name: '--variant <string>',
149-
description:
150-
"Specify your app's build variant. Deprecated! Use 'mode' instead",
151-
},
152140
{
153141
name: '--no-packager',
154142
description: 'Do not launch packager while building',

packages/cli-platform-android/src/commands/runAndroid/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function runOnSpecificDevice(
188188
if (devices.indexOf(deviceId) !== -1) {
189189
let gradleArgs = getTaskNames(
190190
androidProject.appName,
191-
args.mode || args.variant,
191+
args.mode,
192192
args.tasks ?? buildTask,
193193
'install',
194194
androidProject.sourceDir,

packages/cli-platform-android/src/commands/runAndroid/runOnAllDevices.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,12 @@ async function runOnAllDevices(
4747
);
4848
}
4949
}
50-
if (args.variant) {
51-
logger.warn(
52-
'"variant" flag is deprecated and will be removed in future release. Please switch to "mode" flag.',
53-
);
54-
}
5550

5651
try {
5752
if (!args.binaryPath) {
5853
let gradleArgs = getTaskNames(
5954
androidProject.appName,
60-
args.mode || args.variant,
55+
args.mode,
6156
args.tasks,
6257
'install',
6358
androidProject.sourceDir,

0 commit comments

Comments
 (0)