microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
4b124a08cf4726fc4b6b1f843dcd24e31f33db5e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/common/ios/xcodeproj.ts

32lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import * as Q from "q";
5
6import {ErrorHelper} from "../../common/error/errorHelper";
7import {Log} from "../../common/log/log";
8import {FileSystem} from "../../common/node/fileSystem";
9
10import {TelemetryHelper} from "../../common/telemetryHelper";
11
12export class Xcodeproj {
13 private nodeFileSystem: FileSystem;
14
15 constructor({
16 nodeFileSystem = new FileSystem(),
17 } = {}) {
18 this.nodeFileSystem = nodeFileSystem;
19 }
20
21 public findXcodeprojFile(projectRoot: string): Q.Promise<string> {
22 return this.nodeFileSystem
23 .findFilesByExtension(projectRoot, "xcodeproj")
24 .then((projectFiles: string[]) => {
25 if (projectFiles.length > 1) {
26 TelemetryHelper.sendSimpleEvent("multipleXcodeprojFound");
27 Log.logWarning(ErrorHelper.getWarning(`More than one xcodeproj found. Using ${projectFiles[0]}`));
28 }
29 return projectFiles[0];
30 });
31 }
32}