microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0.1.2

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/common/ios/xcodeproj.ts

33lines · modeblame

afc46a73Jimmy Thomson10 years ago1// 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
a4a7e387Meena Kunnathur Balakrishnan10 years ago7import {ErrorHelper} from "../../common/error/errorHelper";
190e393cMeena Kunnathur Balakrishnan10 years ago8import {Log} from "../../common/log/log";
db80cd4eJimmy Thomson10 years ago9import {FileSystem} from "../../common/node/fileSystem";
afc46a73Jimmy Thomson10 years ago10
24c4c0aaJimmy Thomson10 years ago11import {TelemetryHelper} from "../../common/telemetryHelper";
12
afc46a73Jimmy Thomson10 years ago13export class Xcodeproj {
81226dceJimmy Thomson10 years ago14private nodeFileSystem: FileSystem;
15
16constructor({
17nodeFileSystem = new FileSystem()
18} = {}) {
19this.nodeFileSystem = nodeFileSystem;
20}
21
afc46a73Jimmy Thomson10 years ago22public findXcodeprojFile(projectRoot: string): Q.Promise<string> {
81226dceJimmy Thomson10 years ago23return this.nodeFileSystem
afc46a73Jimmy Thomson10 years ago24.findFilesByExtension(path.join(projectRoot, "ios"), "xcodeproj")
25.then((projectFiles: string[]) => {
26if (projectFiles.length > 1) {
642490c1Jimmy Thomson10 years ago27TelemetryHelper.sendSimpleEvent("multipleXcodeprojFound");
a4a7e387Meena Kunnathur Balakrishnan10 years ago28Log.logWarning(ErrorHelper.getWarning(`More than one xcodeproj found. Using ${projectFiles[0]}`));
afc46a73Jimmy Thomson10 years ago29}
30return projectFiles[0];
31});
32}
33}