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

chore(cli): deprecate --configuration option in run-macos #2054

Merged
Merged
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
30 changes: 22 additions & 8 deletions packages/react-native/local-cli/runMacOS/runMacOS.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/**
* @typedef {{
* configuration: string;
* mode: string;
* packager: boolean;
* port: number;
* projectPath: string;
Expand Down Expand Up @@ -47,6 +48,16 @@ function runMacOS(_, _ctx, args) {
);
}

if (args.configuration) {
logger.warn(
'Argument --configuration has been deprecated and will be removed in a future release, please use --mode instead.',
);

if (!args.mode) {
args.mode = args.configuration;
}
}

process.chdir(args.projectPath);

const xcodeProject = findXcodeProject(fs.readdirSync('.'));
Expand Down Expand Up @@ -78,11 +89,7 @@ function runMacOS(_, _ctx, args) {
async function run(xcodeProject, scheme, args) {
await buildProject(xcodeProject, scheme, args);

const buildSettings = getBuildSettings(
xcodeProject,
args.configuration,
scheme,
);
const buildSettings = getBuildSettings(xcodeProject, args.mode, scheme);
const appPath = path.join(
buildSettings.TARGET_BUILD_DIR,
buildSettings.FULL_PRODUCT_NAME,
Expand Down Expand Up @@ -127,7 +134,7 @@ function buildProject(xcodeProject, scheme, args) {
xcodeProject.isWorkspace ? '-workspace' : '-project',
xcodeProject.name,
'-configuration',
args.configuration,
args.mode,
'-scheme',
scheme,
];
Expand Down Expand Up @@ -278,12 +285,19 @@ module.exports = {
options: [
{
name: '--configuration [string]',
description: 'Explicitly set the scheme configuration to use',
description:
'[Deprecated] Explicitly set the scheme configuration to use',
default: 'Debug',
},
{
name: '--mode [string]',
description:
'Explicitly set the scheme configuration to use, corresponds to `--configuration` in `xcodebuild` command, e.g. Debug, Release.',
},
{
name: '--scheme [string]',
description: 'Explicitly set Xcode scheme to use',
description:
'Explicitly set Xcode scheme to use, corresponds to `--scheme` in `xcodebuild` command.',
},
{
name: '--project-path [string]',
Expand Down