From b6560e1c74388670c23baf6d7e967b68fe945235 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Tue, 17 Oct 2023 16:01:08 -0700 Subject: [PATCH] check xcode-select is using the latest major version available Reviewed By: mweststrate Differential Revision: D50369254 fbshipit-source-id: 140a044ca55ec1f445b38e02c7df13cb667d89c6 --- .../fb-stubs/validateSelectedXcodeVersion.tsx | 19 +++++++++++++++++++ desktop/doctor/src/index.tsx | 6 ++++++ 2 files changed, 25 insertions(+) create mode 100644 desktop/doctor/src/fb-stubs/validateSelectedXcodeVersion.tsx diff --git a/desktop/doctor/src/fb-stubs/validateSelectedXcodeVersion.tsx b/desktop/doctor/src/fb-stubs/validateSelectedXcodeVersion.tsx new file mode 100644 index 000000000..b00b39c9e --- /dev/null +++ b/desktop/doctor/src/fb-stubs/validateSelectedXcodeVersion.tsx @@ -0,0 +1,19 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import {FlipperDoctor} from 'flipper-common'; + +export async function validateSelectedXcodeVersion( + _selectedPath: string, +): Promise { + return { + hasProblem: false, + message: '', + }; +} diff --git a/desktop/doctor/src/index.tsx b/desktop/doctor/src/index.tsx index 6e71aa736..b03d687e6 100644 --- a/desktop/doctor/src/index.tsx +++ b/desktop/doctor/src/index.tsx @@ -18,6 +18,7 @@ import * as path from 'path'; import type {FlipperDoctor} from 'flipper-common'; import * as fs_extra from 'fs-extra'; import {getIdbInstallationInstructions} from './fb-stubs/idbInstallationInstructions'; +import {validateSelectedXcodeVersion} from './fb-stubs/validateSelectedXcodeVersion'; export function getHealthchecks(): FlipperDoctor.Healthchecks { return { @@ -196,6 +197,11 @@ export function getHealthchecks(): FlipperDoctor.Healthchecks { message: `xcode-select has path of ${selectedXcode}, however this path does not exist on disk. Run "sudo xcode-select --switch" with a valid Xcode.app path.`, }; } + const validatedXcodeVersion = + await validateSelectedXcodeVersion(selectedXcode); + if (validatedXcodeVersion.hasProblem) { + return validatedXcodeVersion; + } return { hasProblem: false, message: `xcode-select has path of ${selectedXcode}.`,