From aad358f1bf8ecc3fb82486401aa3f27835005e95 Mon Sep 17 00:00:00 2001 From: szymonrybczak Date: Thu, 25 Jan 2024 12:41:21 +0100 Subject: [PATCH 1/2] chore(cli): deprecate `--configuration` --- .../local-cli/runMacOS/runMacOS.js | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/react-native/local-cli/runMacOS/runMacOS.js b/packages/react-native/local-cli/runMacOS/runMacOS.js index 31faa95f2358a7..3a6d8ecde4ef30 100644 --- a/packages/react-native/local-cli/runMacOS/runMacOS.js +++ b/packages/react-native/local-cli/runMacOS/runMacOS.js @@ -9,6 +9,7 @@ /** * @typedef {{ * configuration: string; + * mode: string; * packager: boolean; * port: number; * projectPath: string; @@ -47,6 +48,13 @@ 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.', + ); + args.mode = args.configuration; + } + process.chdir(args.projectPath); const xcodeProject = findXcodeProject(fs.readdirSync('.')); @@ -78,11 +86,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, @@ -127,7 +131,7 @@ function buildProject(xcodeProject, scheme, args) { xcodeProject.isWorkspace ? '-workspace' : '-project', xcodeProject.name, '-configuration', - args.configuration, + args.mode, '-scheme', scheme, ]; @@ -278,9 +282,15 @@ 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. This option is case sensitive.', + }, { name: '--scheme [string]', description: 'Explicitly set Xcode scheme to use', From 6e7669b1eb4144224c7a329e9efffa5e8e3d1b09 Mon Sep 17 00:00:00 2001 From: szymonrybczak Date: Mon, 5 Feb 2024 09:31:31 +0100 Subject: [PATCH 2/2] fix: apply reviewer's comments --- packages/react-native/local-cli/runMacOS/runMacOS.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/react-native/local-cli/runMacOS/runMacOS.js b/packages/react-native/local-cli/runMacOS/runMacOS.js index 3a6d8ecde4ef30..925124d33932f2 100644 --- a/packages/react-native/local-cli/runMacOS/runMacOS.js +++ b/packages/react-native/local-cli/runMacOS/runMacOS.js @@ -52,7 +52,10 @@ function runMacOS(_, _ctx, args) { logger.warn( 'Argument --configuration has been deprecated and will be removed in a future release, please use --mode instead.', ); - args.mode = args.configuration; + + if (!args.mode) { + args.mode = args.configuration; + } } process.chdir(args.projectPath); @@ -289,11 +292,12 @@ module.exports = { { name: '--mode [string]', description: - 'Explicitly set the scheme configuration to use. This option is case sensitive.', + '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]',