Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: remove --variant option from run/build-android command #2026

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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