microsoft/vscode-react-native
Publicmirrored from https://github.com/microsoft/vscode-react-nativeAvailable
src/common/ios/xcodeproj.ts
24lines · modeblame
afc46a73Jimmy Thomson10 years ago | 1 | // Copyright (c) Microsoft Corporation. All rights reserved. |
| 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. | |
| 3 | | |
| 4 | import * as path from "path"; | |
| 5 | import * as Q from "q"; | |
| 6 | | |
b0061ac6Meena Kunnathur Balakrishnan10 years ago | 7 | import {Log} from "../../common/log"; |
| 8 | import {Node} from "../../common/node/node"; | |
afc46a73Jimmy Thomson10 years ago | 9 | |
24c4c0aaJimmy Thomson10 years ago | 10 | import {TelemetryHelper} from "../../common/telemetryHelper"; |
| 11 | | |
afc46a73Jimmy Thomson10 years ago | 12 | export class Xcodeproj { |
| 13 | public findXcodeprojFile(projectRoot: string): Q.Promise<string> { | |
| 14 | return new Node.FileSystem() | |
| 15 | .findFilesByExtension(path.join(projectRoot, "ios"), "xcodeproj") | |
| 16 | .then((projectFiles: string[]) => { | |
| 17 | if (projectFiles.length > 1) { | |
642490c1Jimmy Thomson10 years ago | 18 | TelemetryHelper.sendSimpleEvent("multipleXcodeprojFound"); |
afc46a73Jimmy Thomson10 years ago | 19 | Log.logError(`Warning: more than one xcodeproj found. Using ${projectFiles[0]}`); |
| 20 | } | |
| 21 | return projectFiles[0]; | |
| 22 | }); | |
| 23 | } | |
| 24 | } |