microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
81bc42322869caf8489c2bf431cc4d5a21bd3f95

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/debugger/platformResolver.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 {IRunOptions} from "../common/launchArgs";
5import {IOSPlatform} from "./ios/iOSPlatform";
6import {AndroidPlatform} from "../common/android/androidPlatform";
7
8/**
9 * Contains all the mobile platform specific debugging operations.
10 */
11export interface IAppPlatform {
12 runApp(): Q.Promise<void>;
13 enableJSDebuggingMode(): Q.Promise<void>;
14}
15
16export class PlatformResolver {
17
18 /**
19 * Resolves the mobile application target platform.
20 */
21 public resolveMobilePlatform(mobilePlatformString: string, runOptions: IRunOptions): 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 return new IOSPlatform(runOptions);
27 case "android":
28 return new AndroidPlatform(runOptions);
29 default:
30 return null;
31 }
32 }
33}