microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
db80cd4e10b83524bc77c15018effab72cbabeb8

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 path from "path";
5import * as Q from "q";
6
7import {Log} from "../../common/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(path.join(projectRoot, "ios"), "xcodeproj")
24 .then((projectFiles: string[]) => {
25 if (projectFiles.length > 1) {
26 TelemetryHelper.sendSimpleEvent("multipleXcodeprojFound");
27 Log.logWarning(`More than one xcodeproj found. Using ${projectFiles[0]}`);
28 }
29 return projectFiles[0];
30 });
31 }
32}