microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.1.3

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/common/ios/xcodeproj.ts

33lines · 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 {ErrorHelper} from "../../common/error/errorHelper";
8import {Log} from "../../common/log/log";
9import {FileSystem} from "../../common/node/fileSystem";
10
11import {TelemetryHelper} from "../../common/telemetryHelper";
12
13export class Xcodeproj {
14 private nodeFileSystem: FileSystem;
15
16 constructor({
17 nodeFileSystem = new FileSystem(),
18 } = {}) {
19 this.nodeFileSystem = nodeFileSystem;
20 }
21
22 public findXcodeprojFile(projectRoot: string): Q.Promise<string> {
23 return this.nodeFileSystem
24 .findFilesByExtension(path.join(projectRoot, "ios"), "xcodeproj")
25 .then((projectFiles: string[]) => {
26 if (projectFiles.length > 1) {
27 TelemetryHelper.sendSimpleEvent("multipleXcodeprojFound");
28 Log.logWarning(ErrorHelper.getWarning(`More than one xcodeproj found. Using ${projectFiles[0]}`));
29 }
30 return projectFiles[0];
31 });
32 }
33}