Skip to content

Commit

Permalink
breaking: remove --variant option (#2026)
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak authored Aug 9, 2023
1 parent 6f07e7e commit 4fcd778
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 29 deletions.
9 changes: 1 addition & 8 deletions packages/cli-platform-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ Builds your app and starts it on a connected Android emulator or device.
Override the root directory for the Android build (which contains the android directory)'.

#### `--variant <string>`

> **DEPRECATED** – use "mode" instead
> default: 'debug'
Specify your app's build variant.

#### `--appFolder <string>`

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

Id of the User Profile you want to install the app on.

### `log-android`

Usage:
Expand Down
16 changes: 2 additions & 14 deletions packages/cli-platform-android/src/commands/buildAndroid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {promptForTaskSelection} from '../runAndroid/listAndroidTasks';

export interface BuildFlags {
mode?: string;
variant?: string;
activeArchOnly?: boolean;
packager?: boolean;
port: number;
Expand Down Expand Up @@ -63,12 +62,6 @@ async function buildAndroid(
) {
const androidProject = getAndroidProject(config);

if (args.variant) {
logger.warn(
'"variant" flag is deprecated and will be removed in future release. Please switch to "mode" flag.',
);
}

if (args.tasks && args.mode) {
logger.warn(
'Both "tasks" and "mode" parameters were passed to "build" command. Using "tasks" for building the app.',
Expand All @@ -89,7 +82,7 @@ async function buildAndroid(

let gradleArgs = getTaskNames(
androidProject.appName,
args.mode || args.variant,
args.mode,
tasks,
'bundle',
androidProject.sourceDir,
Expand All @@ -111,7 +104,7 @@ async function buildAndroid(
);
if (architectures.length > 0) {
logger.info(`Detected architectures ${architectures.join(', ')}`);
// `reactNativeDebugArchitectures` was renamed to `reactNativeArchitectures` in 0.68.
// `reactNativeDebugArchitectures` was renamed to `reactNativeArchitectures` in 0.68.
// Can be removed when 0.67 no longer needs to be supported.
gradleArgs.push(
'-PreactNativeDebugArchitectures=' + architectures.join(','),
Expand Down Expand Up @@ -144,11 +137,6 @@ export const options = [
name: '--mode <string>',
description: "Specify your app's build variant",
},
{
name: '--variant <string>',
description:
"Specify your app's build variant. Deprecated! Use 'mode' instead",
},
{
name: '--no-packager',
description: 'Do not launch packager while building',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function runOnSpecificDevice(
if (devices.indexOf(deviceId) !== -1) {
let gradleArgs = getTaskNames(
androidProject.appName,
args.mode || args.variant,
args.mode,
args.tasks ?? buildTask,
'install',
androidProject.sourceDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,12 @@ async function runOnAllDevices(
);
}
}
if (args.variant) {
logger.warn(
'"variant" flag is deprecated and will be removed in future release. Please switch to "mode" flag.',
);
}

try {
if (!args.binaryPath) {
let gradleArgs = getTaskNames(
androidProject.appName,
args.mode || args.variant,
args.mode,
args.tasks,
'install',
androidProject.sourceDir,
Expand Down

0 comments on commit 4fcd778

Please sign in to comment.