microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fb6c0d0507b286c72b88078fd6d7bc0ff2fa682d

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/debugger/platformResolver.ts

35lines · 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 {IRunOptions} from "./launchArgs";
5import * as IOSPlatform from "./ios/iOSPlatform";
6import * as AndroidPlatform from "./android/androidPlatform";
7
8/**
9 * Contains all the mobile platform specific debugging operations.
10 */
11export interface IAppPlatform {
12 runApp(runOptions: IRunOptions): Q.Promise<void>;
13 enableJSDebuggingMode(runOptions: IRunOptions): Q.Promise<void>;
14}
15
16export class PlatformResolver {
17
18 /**
19 * Resolves the mobile application target platform.
20 */
21 public resolveMobilePlatform(mobilePlatformString: string): IAppPlatform {
22 switch (mobilePlatformString) {
23 // We lazyly load the strategies, because some components might be
24 // missing on some platforms (like XCode in Windows)
25 case "ios":
26 let ios: typeof IOSPlatform = require("./ios/iOSPlatform");
27 return new ios.IOSPlatform();
28 case "android":
29 let android: typeof AndroidPlatform = require("./android/androidPlatform");
30 return new android.AndroidPlatform();
31 default:
32 return null;
33 }
34 }
35}